support strings as char lists in term comparisons

This commit is contained in:
Mark Thom
2018-08-23 01:24:26 -06:00
parent ddf5593e44
commit 7884a20042
5 changed files with 114 additions and 77 deletions

View File

@@ -24,7 +24,8 @@ pub struct StringList {
impl Hash for StringList {
fn hash<H: Hasher>(&self, state: &mut H) {
self.borrow().hash(state)
let h = self.borrow().hash(state);
(h, self.cursor, self.expandable).hash(state);
}
}
@@ -63,11 +64,6 @@ impl StringList {
}
}
#[inline]
pub fn cursor(&self) -> usize {
self.cursor
}
#[inline]
pub fn head(&self) -> Option<char> {
self.borrow()[self.cursor ..].chars().next()