Skip to content

pombredanne/patch-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patch

Parse unified diffs with rust

Build Status Crates.io Badge

extern crate patch;
use patch::{parse};

let sample = "\
--- before.py
+++ after.py
@@ -1,4 +1,4 @@
-bacon
-eggs
-ham
+python
+eggy
+hamster
 guido\n";

if let Ok(patch) = parse(sample) {
    assert_eq!(&patch.old.name, "before.py");
    assert_eq!(&patch.new.name, "after.py");
} else {
    panic!("failed to parse sample patch");
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 99.4%
  • Nix 0.6%