From 903d6dd64fc938f6027853560111ba6edfbcdf52 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Tue, 31 Oct 2023 16:30:08 +0100 Subject: [PATCH] parser: remove deprecated collect_until --- src/sh/parse.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/sh/parse.rs b/src/sh/parse.rs index 6b5691a..41a7a52 100644 --- a/src/sh/parse.rs +++ b/src/sh/parse.rs @@ -85,20 +85,11 @@ where It: 'a + Iterator { } } - pub struct WordLexer<'a, It> where It: 'a + Iterator { chars: &'a mut Peekable } -impl<'a, It> WordLexer<'a, It> -where It: Iterator { - fn collect_until(&mut self, close: Option) -> Result { - DelimIter::new(&mut self.chars, vec![(close, true)]) - .try_collect::() - } -} - pub struct SubstLexer<'a, It> where It: 'a + Iterator { chars: &'a mut Peekable @@ -140,8 +131,6 @@ where It: Iterator let word = Word { segments: SubstLexer { chars: &mut s.chars().peekable() } .try_collect::>()? -// .scan((), |_, x| x.ok()) -// .collect::>() }; Ok(WordSegment::DoubleQuote(word)) @@ -362,6 +351,7 @@ where It: 'a + Iterator { // Subshell Some('(') => { self.chars.next(); + let subcmd_str = DelimIter::new(&mut self.chars, vec![(Some(')'), true)]).try_collect::(); match subcmd_str { Ok(subcmd_str) => {