Remove an allocation for lesser block end.
This commit is contained in:
parent
bd5e50d558
commit
f7690ff64b
@ -261,11 +261,10 @@ fn data<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
is_not("\r\n")(input)
|
||||
}
|
||||
|
||||
fn lesser_block_end(current_name: &str) -> impl ContextMatcher {
|
||||
let current_name_lower = current_name.to_lowercase();
|
||||
move |context, input: OrgSource<'_>| {
|
||||
_lesser_block_end(context, input, current_name_lower.as_str())
|
||||
}
|
||||
fn lesser_block_end<'c>(current_name: &'c str) -> impl ContextMatcher + 'c {
|
||||
// Since the lesser block names are statically defined in code, we can simply assert that the name is lowercase instead of causing an allocation by converting to lowercase.
|
||||
debug_assert!(current_name == current_name.to_lowercase());
|
||||
move |context, input: OrgSource<'_>| _lesser_block_end(context, input, current_name)
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
|
Loading…
Reference in New Issue
Block a user