1
Fork 0

Remove redundant to_ident_string calls

This commit is contained in:
Michael Goulet 2025-01-27 01:21:40 +00:00
parent ac1c6c50f4
commit c08624d8d2
10 changed files with 14 additions and 18 deletions

View file

@ -1636,13 +1636,12 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
.enumerate()
.map(|(idx, new)| (new, old_fields.get(idx)))
.map(|(new, old)| {
let new = new.name.to_ident_string();
if let Some(Some(old)) = old
&& new != *old
&& new.as_str() != old
{
format!("{new}: {old}")
} else {
new
new.to_string()
}
})
.collect::<Vec<String>>()