diff --git a/src/combinators.rs b/src/combinators.rs index 764c678..53fdd4e 100644 --- a/src/combinators.rs +++ b/src/combinators.rs @@ -55,16 +55,15 @@ where I: Clone + 'a, { fn parse(&self, input: I) -> ParseResult, I> { - let mut results = Vec::new(); - let mut count: u16 = 0; - let at_least = self.at_least.unwrap_or(0); let at_most = self.at_most.unwrap_or(u16::MAX); if at_most == 0 { - return Ok((results, input)); + return Ok((vec![], input)); } + let mut results = Vec::new(); + let mut count: u16 = 0; let mut further_input = input.clone(); while let Ok((item, rest)) = self.inner_parser.parse(further_input.clone()) {