diff 0.1.0
Library for computing string diffs using LCS algorithm
diff.cairo
A Cairo port of the diff.rs
crate.
To compute a line by line diff between two strings:
let line_by_line_diff = diff::lines(@"left\nbar", @"right\nbaz");
For character level diff:
let char_diff = diff::chars(@"bar", @"baz");
The result is an array of DiffResult
where the latter can store one of three variants:
Both((L, R))
if strings/characters are equalLeft(L)
if the element exists only in the left inputRight(R)
if the element exists only in the right inputVersion 0.1.0
Uploaded 2 months ago
License MIT OR Apache-2.0
Size 2.5 KB
Run the following command in your project dir
scarb add diff@0.1.0
Or add the following line to your Scarb.toml
diff = "0.1.0"
Homepage github.com/m-kus/cairo-pretty-assertions
Repository github.com/m-kus/cairo-pretty-assertions