Apply more suggestions.

This commit is contained in:
Tom Alexander
2023-10-16 18:29:21 -04:00
parent 4b6c717812
commit 3069711447
22 changed files with 86 additions and 114 deletions

View File

@@ -49,7 +49,7 @@ where
{
if immediate_in_section(context, "footnote definition") {
return Err(nom::Err::Error(CustomError::MyError(MyError(
"Cannot nest objects of the same element".into(),
"Cannot nest objects of the same element",
))));
}
start_of_line(remaining)?;
@@ -157,6 +157,7 @@ where
#[cfg(test)]
mod tests {
use super::*;
use crate::context::bind_context;
use crate::context::Context;
use crate::context::GlobalSettings;
use crate::context::List;
@@ -174,7 +175,7 @@ line footnote.",
let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context));
let footnote_definition_matcher = parser_with_context!(element(true))(&initial_context);
let footnote_definition_matcher = bind_context!(element(true), &initial_context);
let (remaining, first_footnote_definition) =
footnote_definition_matcher(input).expect("Parse first footnote_definition");
let (remaining, second_footnote_definition) =
@@ -211,7 +212,7 @@ not in the footnote.",
let global_settings = GlobalSettings::default();
let initial_context = ContextElement::document_context();
let initial_context = Context::new(&global_settings, List::new(&initial_context));
let footnote_definition_matcher = parser_with_context!(element(true))(&initial_context);
let footnote_definition_matcher = bind_context!(element(true), &initial_context);
let (remaining, first_footnote_definition) =
footnote_definition_matcher(input).expect("Parse first footnote_definition");
assert_eq!(Into::<&str>::into(remaining), "not in the footnote.");