diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index 761e74c..5289c6b 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -258,7 +258,6 @@ pub(crate) fn src_block<'b, 'g, 'r, 's>( let (remaining, parameters) = opt(map(tuple((space1, src_parameters)), |(_, parameters)| { parameters }))(remaining)?; - let parameters = parameters.flatten(); let (remaining, _nl) = recognize(tuple((space0, line_ending)))(remaining)?; let lesser_block_end_specialized = lesser_block_end("src"); let contexts = [ @@ -390,15 +389,11 @@ enum SwitchState { } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn src_parameters<'s>(input: OrgSource<'s>) -> Res, Option>> { - let (remaining, parameters) = - recognize(many_till(anychar, peek(tuple((space0, line_ending)))))(input)?; - - if parameters.len() == 0 { - Ok((remaining, None)) - } else { - Ok((remaining, Some(parameters))) - } +fn src_parameters<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { + verify( + recognize(many_till(anychar, peek(tuple((space0, line_ending))))), + |parameters: &OrgSource<'_>| parameters.len() > 0, + )(input) } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]