Simplify headline_end and section_end now that eof is a special case.
This commit is contained in:
parent
cbe7ef4030
commit
204f319a92
@ -129,7 +129,7 @@ fn section<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Sec
|
|||||||
#[tracing::instrument(ret, level = "debug")]
|
#[tracing::instrument(ret, level = "debug")]
|
||||||
fn section_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
fn section_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
||||||
let headline_matcher = parser_with_context!(headline)(context);
|
let headline_matcher = parser_with_context!(headline)(context);
|
||||||
alt((recognize(headline_matcher), eof))(input)
|
recognize(headline_matcher)(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(ret, level = "debug")]
|
#[tracing::instrument(ret, level = "debug")]
|
||||||
@ -181,5 +181,5 @@ fn headline<'r, 's>(
|
|||||||
|
|
||||||
#[tracing::instrument(ret, level = "debug")]
|
#[tracing::instrument(ret, level = "debug")]
|
||||||
fn headline_end<'r, 's>(_context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
fn headline_end<'r, 's>(_context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
||||||
alt((line_ending, eof))(input)
|
line_ending(input)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user