1
Fork 0

compiler: use copied instead of manual map

This commit is contained in:
DaniPopes 2023-11-03 17:18:19 +01:00
parent e6779d98ee
commit 27364309a5
No known key found for this signature in database
GPG key ID: 0F09640DDB7AC692
6 changed files with 8 additions and 9 deletions

View file

@ -715,7 +715,7 @@ pub trait LintContext: Sized {
db.note("see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information");
},
BuiltinLintDiagnostics::UnexpectedCfgName((name, name_span), value) => {
let possibilities: Vec<Symbol> = sess.parse_sess.check_config.expecteds.keys().map(|s| *s).collect();
let possibilities: Vec<Symbol> = sess.parse_sess.check_config.expecteds.keys().copied().collect();
// Suggest the most probable if we found one
if let Some(best_match) = find_best_match_for_name(&possibilities, name, None) {