X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_data_structures%2Fsrc%2Fvec_map.rs;h=cc7ec9432faed31803376bbc5113cebd642229ca;hb=2ff7ea4de291b437912c5082b6c92fefe7d6457f;hp=2f4b3844430e38afaf4ac523d09de47a10f59317;hpb=e7cc3bddbe0d0e374d05e7003e662bba1742dbae;p=rust.git diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs index 2f4b3844430..cc7ec9432fa 100644 --- a/compiler/rustc_data_structures/src/vec_map.rs +++ b/compiler/rustc_data_structures/src/vec_map.rs @@ -30,11 +30,6 @@ pub fn insert(&mut self, k: K, v: V) -> Option { } } - /// Removes the entry from the map and returns the removed value - pub fn remove(&mut self, k: &K) -> Option { - self.0.iter().position(|(k2, _)| k2 == k).map(|pos| self.0.remove(pos).1) - } - /// Gets a reference to the value in the entry. pub fn get(&self, k: &Q) -> Option<&V> where @@ -44,15 +39,6 @@ pub fn get(&self, k: &Q) -> Option<&V> self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1) } - /// Gets a mutable reference to the value in the entry. - pub fn get_mut(&mut self, k: &Q) -> Option<&mut V> - where - K: Borrow, - Q: Eq, - { - self.0.iter_mut().find(|(key, _)| k == key.borrow()).map(|elem| &mut elem.1) - } - /// Returns the any value corresponding to the supplied predicate filter. /// /// The supplied predicate will be applied to each (key, value) pair and it will return a @@ -72,7 +58,7 @@ pub fn get_value_matching(&self, mut predicate: impl FnMut(&(K, V)) -> bool) -> // This should return just one element, otherwise it's a bug assert!( filter.next().is_none(), - "Collection {:#?} should have just one matching element", + "Collection {:?} should have just one matching element", self ); Some(value)