From 903d6dd64fc938f6027853560111ba6edfbcdf52 Mon Sep 17 00:00:00 2001 From: Michael Sippel <micha@fragmental.art> 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<Item = char> { } } - pub struct WordLexer<'a, It> where It: 'a + Iterator<Item = char> { chars: &'a mut Peekable<It> } -impl<'a, It> WordLexer<'a, It> -where It: Iterator<Item = char> { - fn collect_until(&mut self, close: Option<char>) -> Result<String, LexError> { - DelimIter::new(&mut self.chars, vec![(close, true)]) - .try_collect::<String>() - } -} - pub struct SubstLexer<'a, It> where It: 'a + Iterator<Item = char> { chars: &'a mut Peekable<It> @@ -140,8 +131,6 @@ where It: Iterator<Item = char> let word = Word { segments: SubstLexer { chars: &mut s.chars().peekable() } .try_collect::<Vec<_>>()? -// .scan((), |_, x| x.ok()) -// .collect::<Vec<_>>() }; Ok(WordSegment::DoubleQuote(word)) @@ -362,6 +351,7 @@ where It: 'a + Iterator<Item = char> { // Subshell Some('(') => { self.chars.next(); + let subcmd_str = DelimIter::new(&mut self.chars, vec![(Some(')'), true)]).try_collect::<String>(); match subcmd_str { Ok(subcmd_str) => {