Rollup merge of #95881 - TaKO8Ki:use-to-string-instead-of-format, r=compiler-errors

Use `to_string` instead of `format!`
This commit is contained in:
Matthias Krüger 2022-04-12 08:46:57 +02:00 committed by GitHub
commit 3ff5cb20b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -970,7 +970,7 @@ fn parse_crate_name_with_dashes(&mut self) -> PResult<'a, Ident> {
}
if fixed_crate_name {
let fixed_name_sp = ident.span.to(idents.last().unwrap().span);
let mut fixed_name = format!("{}", ident.name);
let mut fixed_name = ident.name.to_string();
for part in idents {
fixed_name.push_str(&format!("_{}", part.name));
}