diff 0.1.0

Library for computing string diffs using LCS algorithm

Readme

diff.cairo

A Cairo port of the diff.rs crate.

Usage

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 equal
  • Left(L) if the element exists only in the left input
  • Right(R) if the element exists only in the right input

Metadata

Version 0.1.0

Uploaded 1 month ago

License MIT OR Apache-2.0

Size 2.5 KB

Installation

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"

Monthly downloads

Links

Homepage github.com/m-kus/cairo-pretty-assertions

Repository github.com/m-kus/cairo-pretty-assertions

Owners