Rollup merge of #117549 - DaniPopes:more-copied, r=b-naber

Use `copied` instead of manual `map`
This commit is contained in:
Matthias Krüger 2023-11-17 23:04:22 +01:00 committed by GitHub
commit aa2289d3bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 11 deletions

View file

@ -703,7 +703,7 @@ pub trait LintContext {
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) {