From c3466bedf8bd634c9c1aba25a3790bf8ae5e89d7 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 26 Apr 2017 14:52:23 -0700 Subject: [PATCH] refactor(header): fix more ?Sized for 1.10 --- src/header/internals/vec_map.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/header/internals/vec_map.rs b/src/header/internals/vec_map.rs index 3541c2b4d2..9ee0c7c9d6 100644 --- a/src/header/internals/vec_map.rs +++ b/src/header/internals/vec_map.rs @@ -39,14 +39,12 @@ impl VecMap { } #[inline] - pub fn get_mut(&mut self, key: &K2) -> Option<&mut V> - where K2: PartialEq { + pub fn get_mut + ?Sized>(&mut self, key: &K2) -> Option<&mut V> { self.find(key).map(move |pos| &mut self.vec[pos].1) } #[inline] - pub fn contains_key(&self, key: &K2) -> bool - where K2: PartialEq { + pub fn contains_key + ?Sized>(&self, key: &K2) -> bool { self.find(key).is_some() } @@ -67,8 +65,7 @@ impl VecMap { } #[inline] - fn find(&self, key: &K2) -> Option - where K2: PartialEq + ?Sized { + fn find + ?Sized>(&self, key: &K2) -> Option { self.vec.iter().position(|entry| key == &entry.0) } }