Remove Lookahead1::cursor method
diff --git a/src/lookahead.rs b/src/lookahead.rs
index a63b9f2..15e0346 100644
--- a/src/lookahead.rs
+++ b/src/lookahead.rs
@@ -78,7 +78,7 @@
impl<'a> Lookahead1<'a> {
pub fn peek<T: Peek>(&self, token: T) -> bool {
let _ = token;
- if T::Token::peek(self) {
+ if T::Token::peek(self.cursor) {
return true;
}
self.comparisons.borrow_mut().push(T::Token::display());
@@ -104,10 +104,6 @@
}
}
}
-
- pub fn cursor(&self) -> Cursor<'a> {
- self.cursor
- }
}
/// Types that can be parsed by looking at just one token.
@@ -136,8 +132,8 @@
}
}
-pub fn is_delimiter(lookahead: &Lookahead1, delimiter: Delimiter) -> bool {
- lookahead.cursor.group(delimiter).is_some()
+pub fn is_delimiter(cursor: Cursor, delimiter: Delimiter) -> bool {
+ cursor.group(delimiter).is_some()
}
mod private {