Apply more suggestions.
This commit is contained in:
@@ -139,14 +139,7 @@ fn pathreg<'b, 'g, 'r, 's>(
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, PathReg<'s>> {
|
||||
let (remaining, path) = map_parser(
|
||||
escaped(
|
||||
take_till1(|c| match c {
|
||||
'\\' | '[' | ']' => true,
|
||||
_ => false,
|
||||
}),
|
||||
'\\',
|
||||
anychar,
|
||||
),
|
||||
escaped(take_till1(|c| matches!(c, '\\' | '[' | ']')), '\\', anychar),
|
||||
parser_with_context!(parse_path_reg)(context),
|
||||
)(input)?;
|
||||
Ok((remaining, path))
|
||||
@@ -262,11 +255,8 @@ fn apply_link_templates<'b, 'g, 'r, 's>(
|
||||
};
|
||||
}
|
||||
// Handle lingering state
|
||||
match state {
|
||||
ParserState::Percent => {
|
||||
ret.push('%');
|
||||
}
|
||||
_ => {}
|
||||
if let ParserState::Percent = state {
|
||||
ret.push('%');
|
||||
}
|
||||
if !injected_value {
|
||||
ret.push_str(inject_value);
|
||||
@@ -494,6 +484,6 @@ fn impl_path_reg_end<'b, 'g, 'r, 's>(
|
||||
}
|
||||
|
||||
Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||
"No path reg end".into(),
|
||||
"No path reg end",
|
||||
))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user