diff --git a/src/lib.rs b/src/lib.rs index 760bda8..27148c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -156,18 +156,19 @@ where fn one_or_more(parser: P) -> impl Parser, I> where - P: Parser, - I: Copy, + P: Parser + 'static, + I: Copy + 'static, + O: 'static, { let parser = std::rc::Rc::new(parser); - map( - seq(parser.clone(), zero_or_more(parser)), - |(first, rest)| { + parser + .clone() + .then(zero_or_more(parser)) + .map(|(first, rest)| { let mut output = vec![first]; output.extend(rest.into_iter()); output - }, - ) + }) } /// Parses a standard identifier in a programming language