mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 03:53:20 +00:00
16 lines
293 B
Rust
16 lines
293 B
Rust
|
// run-rustfix
|
||
|
|
||
|
#![allow(unused, clippy::needless_pass_by_value)]
|
||
|
#![warn(clippy::map_entry)]
|
||
|
|
||
|
use std::collections::{BTreeMap, HashMap};
|
||
|
use std::hash::Hash;
|
||
|
|
||
|
fn foo() {}
|
||
|
|
||
|
fn insert_if_absent0<K: Eq + Hash, V>(m: &mut HashMap<K, V>, k: K, v: V) {
|
||
|
m.entry(k).or_insert(v);
|
||
|
}
|
||
|
|
||
|
fn main() {}
|