Added an example that shows how similar performs for large diffs
This commit is contained in:
parent
1d176426e6
commit
14874efedc
2 changed files with 12 additions and 0 deletions
|
|
@ -61,5 +61,9 @@ required-features = ["text", "bytes"]
|
|||
name = "close-matches"
|
||||
required-features = ["text"]
|
||||
|
||||
[[example]]
|
||||
name = "large"
|
||||
required-features = ["text"]
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
|
|
|
|||
8
examples/large.rs
Normal file
8
examples/large.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use similar::TextDiff;
|
||||
|
||||
fn main() {
|
||||
let x = "abc".repeat(2000);
|
||||
let y = "abd".repeat(2000);
|
||||
let diff = TextDiff::from_chars(&x, &y);
|
||||
println!("{}", diff.unified_diff());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue