refactor(header): fix more ?Sized for 1.10
This commit is contained in:
@@ -39,14 +39,12 @@ impl<K: PartialEq, V> VecMap<K, V> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_mut<K2>(&mut self, key: &K2) -> Option<&mut V>
|
pub fn get_mut<K2: PartialEq<K> + ?Sized>(&mut self, key: &K2) -> Option<&mut V> {
|
||||||
where K2: PartialEq<K> {
|
|
||||||
self.find(key).map(move |pos| &mut self.vec[pos].1)
|
self.find(key).map(move |pos| &mut self.vec[pos].1)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn contains_key<K2>(&self, key: &K2) -> bool
|
pub fn contains_key<K2: PartialEq<K> + ?Sized>(&self, key: &K2) -> bool {
|
||||||
where K2: PartialEq<K> {
|
|
||||||
self.find(key).is_some()
|
self.find(key).is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,8 +65,7 @@ impl<K: PartialEq, V> VecMap<K, V> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn find<K2>(&self, key: &K2) -> Option<usize>
|
fn find<K2: PartialEq<K> + ?Sized>(&self, key: &K2) -> Option<usize> {
|
||||||
where K2: PartialEq<K> + ?Sized {
|
|
||||||
self.vec.iter().position(|entry| key == &entry.0)
|
self.vec.iter().position(|entry| key == &entry.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user