Make SequenceMatcher generic over all slice types

This commit is contained in:
nmlgc
2018-07-03 20:28:11 +02:00
parent de82e46021
commit 6fd59b0c08
7 changed files with 89 additions and 132 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ fn main() {
}
//SequenceMatcher examples
let mut matcher = SequenceMatcher::new("one two three four", "zero one tree four");
let mut matcher = SequenceMatcher::new(b"one two three four", b"zero one tree four");
let m = matcher.find_longest_match(0, 18, 0, 18);
println!("{:?}", m);
let all_matches = matcher.get_matching_blocks();
@@ -58,6 +58,6 @@ fn main() {
println!("{:?}", grouped_opcodes);
let ratio = matcher.ratio();
println!("{:?}", ratio);
matcher.set_seqs("aaaaa", "aaaab");
matcher.set_seqs(b"aaaaa", b"aaaab");
println!("{:?}", matcher.ratio());
}