From 5c760f055544a694af24226aa1272e0ccbb4f5cf Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 5 Sep 2019 00:24:45 +0900 Subject: [PATCH] Improve tests --- tests/ui/entry.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ui/entry.rs b/tests/ui/entry.rs index eebf2518a65c..0c84cd325c4d 100644 --- a/tests/ui/entry.rs +++ b/tests/ui/entry.rs @@ -69,7 +69,14 @@ fn insert_other_if_absent(m: &mut HashMap, k: K, o: K, v: } // should not trigger, because the one uses different HashMap from another one -fn insert_other(m: &mut HashMap, n: &mut HashMap, k: K, v: V) { +fn insert_from_different_map(m: HashMap, n: &mut HashMap, k: K, v: V) { + if !m.contains_key(&k) { + n.insert(k, v); + } +} + +// should not trigger, because the one uses different HashMap from another one +fn insert_from_different_map2(m: &mut HashMap, n: &mut HashMap, k: K, v: V) { if !m.contains_key(&k) { n.insert(k, v); }