]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_resolve/src/diagnostics.rs
Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisa
[rust.git] / compiler / rustc_resolve / src / diagnostics.rs
index a820f700869b211ef7b6e0ef63386cc36656025c..d74e26fc84498cf6c3bf997ccd68b558ad64a5ca 100644 (file)
@@ -1627,7 +1627,7 @@ pub(crate) fn add_typo_suggestion(
                     "{}{} `{}` defined here",
                     prefix,
                     suggestion.res.descr(),
-                    suggestion.candidate.as_str(),
+                    suggestion.candidate,
                 ),
             );
         }
@@ -2603,12 +2603,12 @@ fn show_candidates(
                 .skip(1)
                 .all(|(_, descr, _, _)| descr == descr_first)
             {
-                descr_first.to_string()
+                descr_first
             } else {
-                "item".to_string()
+                "item"
             };
             let plural_descr =
-                if descr.ends_with("s") { format!("{}es", descr) } else { format!("{}s", descr) };
+                if descr.ends_with('s') { format!("{}es", descr) } else { format!("{}s", descr) };
 
             let mut msg = format!("{}these {} exist but are inaccessible", prefix, plural_descr);
             let mut has_colon = false;