diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index d5d75c0..f9451ca 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -128,7 +128,7 @@ fn _detect_element<'r, 's>( input: OrgSource<'s>, can_be_paragraph: bool, ) -> Res, ()> { - if detect_plain_list(context, input).is_ok() { + if detect_plain_list(input).is_ok() { return Ok((input, ())); } if _element(context, input, can_be_paragraph).is_ok() { diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index a2cc7c2..8773008 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -38,10 +38,7 @@ use crate::parser::util::maybe_consume_trailing_whitespace_if_not_exiting; use crate::parser::util::start_of_line; #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -pub fn detect_plain_list<'r, 's>( - _context: Context<'r, 's>, - input: OrgSource<'s>, -) -> Res, ()> { +pub fn detect_plain_list<'s>(input: OrgSource<'s>) -> Res, ()> { if verify( tuple(( start_of_line, @@ -522,24 +519,21 @@ dolar"#, r#"+ "#, ); - let initial_context: ContextTree<'_, '_> = ContextTree::new(); - let result = detect_plain_list(&initial_context, input); + let result = detect_plain_list(input); assert!(result.is_ok()); } #[test] fn detect_eof() { let input = OrgSource::new(r#"+"#); - let initial_context: ContextTree<'_, '_> = ContextTree::new(); - let result = detect_plain_list(&initial_context, input); + let result = detect_plain_list(input); assert!(result.is_ok()); } #[test] fn detect_no_gap() { let input = OrgSource::new(r#"+foo"#); - let initial_context: ContextTree<'_, '_> = ContextTree::new(); - let result = detect_plain_list(&initial_context, input); + let result = detect_plain_list(input); // Since there is no whitespace after the '+' this is a paragraph, not a plain list. assert!(result.is_err()); } @@ -547,8 +541,7 @@ dolar"#, #[test] fn detect_with_gap() { let input = OrgSource::new(r#"+ foo"#); - let initial_context: ContextTree<'_, '_> = ContextTree::new(); - let result = detect_plain_list(&initial_context, input); + let result = detect_plain_list(input); assert!(result.is_ok()); } }