add diffy, prettydiff

This commit is contained in:
2020-07-04 01:09:01 +08:00
parent 1ec2a1c20c
commit 90f93df98a
6 changed files with 527 additions and 0 deletions

16
diffy/src/main.rs Normal file
View File

@@ -0,0 +1,16 @@
use diffy::PatchFormatter;
const A: &str = r##"
hello world
hatter
"##;
const B: &str = r##"
hello world
hatterj
"##;
fn main() {
let patch = diffy::create_patch(A, B);
let f = PatchFormatter::new().with_color();
print!("{}", f.fmt_patch(&patch));
}