blob: 1218202f02b95ab23b2799aad847142588dab7c5 [file] [log] [blame] [edit]
#![warn(clippy::map_entry)]
#![allow(dead_code)]
use std::collections::BTreeMap;
fn foo() {}
fn btree_map<K: Eq + Ord + Copy, V: Copy>(m: &mut BTreeMap<K, V>, k: K, v: V) {
// insert then do something, use if let
if let std::collections::btree_map::Entry::Vacant(e) = m.entry(k) {
//~^ map_entry
e.insert(v);
foo();
}
}
fn main() {}