summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5d6c3d3..e0c7fa0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,6 +29,17 @@ pub enum ParserFinishedError<I: Input> {
Unfinished(InputIter<I>),
}
+impl<I> ParserFinishedError<I>
+where
+ I: Input,
+{
+ pub fn rest(&self) -> I {
+ let (Self::Err(it) | Self::Unfinished(it)) = self;
+
+ it.rest()
+ }
+}
+
pub trait Parser<I: Input>: Sized {
type Output;