Move telemetry handling to the tracing-specific main function.
All checks were successful
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded

This is so main_body can exit with an error at any time without missing the shutdown_telemetry function. This does not catch panics.
This commit is contained in:
Tom Alexander
2023-08-16 16:05:16 -04:00
parent dae46adc12
commit e5e5120a10
2 changed files with 16 additions and 32 deletions

View File

@@ -241,18 +241,7 @@ fn plain_list_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn plain_list_item_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
let current_item_indent_level: &usize =
get_context_item_indent(context).ok_or(nom::Err::Error(CustomError::MyError(MyError(
"Not inside a plain list item",
))))?;
let plain_list_item_matcher = parser_with_context!(plain_list_item)(context);
let line_indented_lte_matcher = parser_with_context!(line_indented_lte)(context);
alt((
recognize(verify(plain_list_item_matcher, |pli| {
pli.indentation <= *current_item_indent_level
})),
recognize(line_indented_lte_matcher),
))(input)
recognize(parser_with_context!(line_indented_lte)(context))(input)
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]