Remove double option.
This commit is contained in:
parent
11a7234900
commit
3742f4fa08
@ -258,7 +258,6 @@ pub(crate) fn src_block<'b, 'g, 'r, 's>(
|
|||||||
let (remaining, parameters) = opt(map(tuple((space1, src_parameters)), |(_, parameters)| {
|
let (remaining, parameters) = opt(map(tuple((space1, src_parameters)), |(_, parameters)| {
|
||||||
parameters
|
parameters
|
||||||
}))(remaining)?;
|
}))(remaining)?;
|
||||||
let parameters = parameters.flatten();
|
|
||||||
let (remaining, _nl) = recognize(tuple((space0, line_ending)))(remaining)?;
|
let (remaining, _nl) = recognize(tuple((space0, line_ending)))(remaining)?;
|
||||||
let lesser_block_end_specialized = lesser_block_end("src");
|
let lesser_block_end_specialized = lesser_block_end("src");
|
||||||
let contexts = [
|
let contexts = [
|
||||||
@ -390,15 +389,11 @@ enum SwitchState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||||
fn src_parameters<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, Option<OrgSource<'s>>> {
|
fn src_parameters<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||||
let (remaining, parameters) =
|
verify(
|
||||||
recognize(many_till(anychar, peek(tuple((space0, line_ending)))))(input)?;
|
recognize(many_till(anychar, peek(tuple((space0, line_ending))))),
|
||||||
|
|parameters: &OrgSource<'_>| parameters.len() > 0,
|
||||||
if parameters.len() == 0 {
|
)(input)
|
||||||
Ok((remaining, None))
|
|
||||||
} else {
|
|
||||||
Ok((remaining, Some(parameters)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||||
|
Loading…
Reference in New Issue
Block a user