diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index 640ebcc..03a26d3 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -21,13 +21,10 @@ use super::util::get_consumed; use super::util::maybe_consume_trailing_whitespace_if_not_exiting; use super::Context; -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use crate::parser::parser_with_context::parser_with_context; use crate::parser::table::org_mode_table; use nom::branch::alt; -use nom::combinator::cond; use nom::combinator::map; use nom::combinator::verify; use nom::multi::many0; diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 484020c..5c15235 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -162,6 +162,7 @@ pub fn plain_list_item<'r, 's>( })); let element_matcher = element(true); + let element_matcher = &element_matcher; let with_consume_matcher = parser_with_context!(element_matcher)(&with_consume_context); let without_consume_matcher = parser_with_context!(element_matcher)(&without_consume_context); let exit_matcher = parser_with_context!(exit_matcher_parser)(&with_consume_context); @@ -185,12 +186,12 @@ pub fn plain_list_item<'r, 's>( Err(_) => { let (remaining, _ws) = space1(remaining)?; let (remaining, (mut contents, final_element)) = many_till( - with_consume_matcher, + &with_consume_matcher, alt(( - terminated(without_consume_matcher, exit_matcher), + terminated(&without_consume_matcher, exit_matcher), preceded( - peek(tuple((with_consume_matcher, exit_matcher))), - without_consume_matcher, + peek(tuple((&with_consume_matcher, exit_matcher))), + &without_consume_matcher, ), )), )(remaining)?;