From 6ff4cbe4f182b4b20cdb01198098d9d3c493ca5d Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Fri, 18 Mar 2022 00:20:24 +0000 Subject: [PATCH] Rename put to insert --- agb/src/hash_map.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/agb/src/hash_map.rs b/agb/src/hash_map.rs index 87f36d0e..104d4f77 100644 --- a/agb/src/hash_map.rs +++ b/agb/src/hash_map.rs @@ -202,7 +202,7 @@ impl HashMap where K: Eq + Hash, { - pub fn put(&mut self, key: K, value: V) -> Option { + pub fn insert(&mut self, key: K, value: V) -> Option { let hash = self.hash(&key); if let Some(location) = self.get_location(&key, hash) { @@ -303,7 +303,7 @@ mod test { let mut map = HashMap::new(); for i in 0..8 { - map.put(i, i % 4); + map.insert(i, i % 4); } for i in 0..8 { @@ -316,7 +316,7 @@ mod test { let mut map = HashMap::new(); for i in 0..8 { - map.put(i / 2, true); + map.insert(i / 2, true); } assert_eq!(map.len(), 4); @@ -327,7 +327,7 @@ mod test { let mut map = HashMap::new(); for i in 0..8 { - map.put(i, i % 3); + map.insert(i, i % 3); } assert_eq!(map.get(&12), None); @@ -338,7 +338,7 @@ mod test { let mut map = HashMap::new(); for i in 0..8 { - map.put(i, i % 3); + map.insert(i, i % 3); } for i in 0..4 { @@ -355,7 +355,7 @@ mod test { let mut map = HashMap::new(); for i in 0..8 { - map.put(i, i); + map.insert(i, i); } let mut max_found = -1; @@ -375,7 +375,7 @@ mod test { let mut map = HashMap::new(); for i in 0..65 { - map.put(i, i % 4); + map.insert(i, i % 4); } for i in 0..65 {