Apply more suggestions.

This commit is contained in:
Tom Alexander
2023-10-16 18:29:21 -04:00
parent 4b6c717812
commit 3069711447
22 changed files with 86 additions and 114 deletions

View File

@@ -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"))]