side-by-side-diff

Crates.ioside-by-side-diff
lib.rsside-by-side-diff
version0.1.2
sourcesrc
created_at2023-02-18 10:56:43.199832
updated_at2023-02-18 14:30:57.164275
descriptionCreate side-by-side diff text.
homepagehttps://github.com/tadashi-aikawa/side-by-side-diff
repositoryhttps://github.com/tadashi-aikawa/side-by-side-diff
max_upload_size
id788131
size7,805
Tadashi Aikawa (tadashi-aikawa)

documentation

https://docs.rs/side-by-side-diff

README

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                  |
Commit count: 17

cargo fmt