Apply more suggestions.
This commit is contained in:
@@ -60,21 +60,16 @@ fn name<'b, 'g, 'r, 's>(
|
||||
let result = tuple((
|
||||
tag::<_, _, CustomError<_>>(entity.name),
|
||||
alt((
|
||||
verify(map(tag("{}"), |_| true), |_| !entity.name.ends_with(" ")),
|
||||
verify(map(tag("{}"), |_| true), |_| !entity.name.ends_with(' ')),
|
||||
map(peek(recognize(entity_end)), |_| false),
|
||||
)),
|
||||
))(input);
|
||||
match result {
|
||||
Ok((remaining, (ent, use_brackets))) => {
|
||||
return Ok((remaining, (entity, ent, use_brackets)));
|
||||
}
|
||||
Err(_) => {}
|
||||
if let Ok((remaining, (ent, use_brackets))) = result {
|
||||
return Ok((remaining, (entity, ent, use_brackets)));
|
||||
}
|
||||
}
|
||||
|
||||
Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||
"NoEntity".into(),
|
||||
))))
|
||||
Err(nom::Err::Error(CustomError::MyError(MyError("NoEntity"))))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
|
||||
Reference in New Issue
Block a user