From 8fae8ec266f1eef3c52cbc9ad114abc4950d19d9 Mon Sep 17 00:00:00 2001 From: John Turner Date: Sun, 23 Nov 2025 07:18:44 +0000 Subject: add rest method to ParserFinishedError --- src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 { Unfinished(InputIter), } +impl ParserFinishedError +where + I: Input, +{ + pub fn rest(&self) -> I { + let (Self::Err(it) | Self::Unfinished(it)) = self; + + it.rest() + } +} + pub trait Parser: Sized { type Output; -- cgit v1.2.3