3 #![allow(unused, clippy::needless_pass_by_value, clippy::collapsible_if)]
4 #![warn(clippy::map_entry)]
6 use std::collections::{BTreeMap, HashMap};
10 ($e:expr) => {{ $e }};
15 fn insert_if_absent0<K: Eq + Hash + Copy, V: Copy>(m: &mut HashMap<K, V>, k: K, v: V, v2: V) {
17 std::collections::hash_map::Entry::Vacant(e) => {
20 std::collections::hash_map::Entry::Occupied(mut e) => {
26 std::collections::hash_map::Entry::Occupied(mut e) => {
29 std::collections::hash_map::Entry::Vacant(e) => {
34 if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
40 if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
47 std::collections::hash_map::Entry::Vacant(e) => {
50 std::collections::hash_map::Entry::Occupied(mut e) => {
56 std::collections::hash_map::Entry::Occupied(mut e) => {
57 if true { Some(e.insert(v)) } else { Some(e.insert(v2)) }
59 std::collections::hash_map::Entry::Vacant(e) => {
65 if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {