#side #diff #text #side-by-side

side-by-side-diff

Create side-by-side diff text

3 releases

0.1.2 Feb 18, 2023
0.1.1 Feb 18, 2023
0.1.0 Feb 18, 2023

#20 in #side

Download history 2/week @ 2024-06-30 4/week @ 2024-09-22 47/week @ 2024-09-29 1/week @ 2024-10-06

52 downloads per month

MIT license

6KB
81 lines

side-by-side-diff

Latest Version Crates.io License

The side-by-side-diff crate is a wrapper of Similar. The side-by-side-diff creates side-by-side diff text from two texts.

use side_by_side_diff::create_side_by_side_diff;

fn main() {
    let diff = create_side_by_side_diff("aaa\niii\nuuu", "aaa\nii\nuuu", 20);
    println!("{diff}");
}
$ cargo run
     1 | aaa                  |      1 | aaa                  |
     2 | iii                  |        |                      |
       |                      |      2 | ii                   |
     3 | uuu                  |      3 | uuu                  |

Dependencies

~1.5MB
~22K SLoC