Remove generic types from Differ

The entire implementation pretty much only makes sense for string
slices, and that was all the original code supported anyway.
This commit is contained in:
nmlgc
2018-07-01 18:41:22 +02:00
parent e2bbf92e4c
commit 282c139cc0
2 changed files with 32 additions and 31 deletions
+13
View File
@@ -104,6 +104,19 @@ impl<'a> Sequence for Vec<String> {
}
}
impl<'a> Sequence for [&'a str] {
fn len(&self) -> usize {
self.len()
}
fn at_index(&self, index: usize) -> Option<&str> {
if index < self.len() {
return Some(self[index]);
}
None
}
}
pub struct SequenceMatcher<'a, T: 'a + ?Sized + Sequence> {
first_sequence: &'a T,
second_sequence: &'a T,