diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-27 01:21:40 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-27 01:23:34 +0000 |
| commit | c08624d8d218beb86d89a794ab285144248c7545 (patch) | |
| tree | 67b9fd5d1c4defa9d82d8a5c459065aa39dc9b46 /compiler/rustc_resolve/src | |
| parent | ac1c6c50f4a82a34002231d2c1a2a5a007af959f (diff) | |
| download | rust-c08624d8d218beb86d89a794ab285144248c7545.tar.gz rust-c08624d8d218beb86d89a794ab285144248c7545.zip | |
Remove redundant to_ident_string calls
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 17c92c7b501..2db8087fd83 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -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>>() |
