diff options
Diffstat (limited to 'vendor/zerovec/src/map')
-rw-r--r-- | vendor/zerovec/src/map/borrowed.rs | 14 | ||||
-rw-r--r-- | vendor/zerovec/src/map/map.rs | 4 | ||||
-rw-r--r-- | vendor/zerovec/src/map/serde.rs | 8 |
3 files changed, 8 insertions, 18 deletions
diff --git a/vendor/zerovec/src/map/borrowed.rs b/vendor/zerovec/src/map/borrowed.rs index 4c1d1aef6..9d0854601 100644 --- a/vendor/zerovec/src/map/borrowed.rs +++ b/vendor/zerovec/src/map/borrowed.rs @@ -163,11 +163,6 @@ where /// let borrowed = map.as_borrowed(); /// assert_eq!(borrowed.get(&1), Some("one")); /// assert_eq!(borrowed.get(&3), None); - /// - /// let borrow = borrowed.get(&1); - /// drop(borrowed); - /// // still exists after the ZeroMapBorrowed has been dropped - /// assert_eq!(borrow, Some("one")); /// ``` pub fn get(&self, key: &K) -> Option<&'a V::GetType> { let index = self.keys.zvl_binary_search(key).ok()?; @@ -190,11 +185,6 @@ where /// let borrowed = map.as_borrowed(); /// assert_eq!(borrowed.get_by(|probe| probe.cmp(&1)), Some("one")); /// assert_eq!(borrowed.get_by(|probe| probe.cmp(&3)), None); - /// - /// let borrow = borrowed.get_by(|probe| probe.cmp(&1)); - /// drop(borrowed); - /// // still exists after the ZeroMapBorrowed has been dropped - /// assert_eq!(borrow, Some("one")); /// ``` pub fn get_by(&self, predicate: impl FnMut(&K) -> Ordering) -> Option<&'a V::GetType> { let index = self.keys.zvl_binary_search_by(predicate).ok()?; @@ -211,8 +201,8 @@ where /// map.insert(&1, "one"); /// map.insert(&2, "two"); /// let borrowed = map.as_borrowed(); - /// assert_eq!(borrowed.contains_key(&1), true); - /// assert_eq!(borrowed.contains_key(&3), false); + /// assert!(borrowed.contains_key(&1)); + /// assert!(!borrowed.contains_key(&3)); /// ``` pub fn contains_key(&self, key: &K) -> bool { self.keys.zvl_binary_search(key).is_ok() diff --git a/vendor/zerovec/src/map/map.rs b/vendor/zerovec/src/map/map.rs index 379b22667..692e265d6 100644 --- a/vendor/zerovec/src/map/map.rs +++ b/vendor/zerovec/src/map/map.rs @@ -194,8 +194,8 @@ where /// let mut map = ZeroMap::new(); /// map.insert(&1, "one"); /// map.insert(&2, "two"); - /// assert_eq!(map.contains_key(&1), true); - /// assert_eq!(map.contains_key(&3), false); + /// assert!(map.contains_key(&1)); + /// assert!(!map.contains_key(&3)); /// ``` pub fn contains_key(&self, key: &K) -> bool { self.keys.zvl_binary_search(key).is_ok() diff --git a/vendor/zerovec/src/map/serde.rs b/vendor/zerovec/src/map/serde.rs index dbe4b433d..e82886d2a 100644 --- a/vendor/zerovec/src/map/serde.rs +++ b/vendor/zerovec/src/map/serde.rs @@ -9,7 +9,7 @@ use serde::de::{self, Deserialize, Deserializer, MapAccess, SeqAccess, Visitor}; #[cfg(feature = "serde")] use serde::ser::{Serialize, SerializeMap, SerializeSeq, Serializer}; -/// This impl can be made available by enabling the optional `serde` feature of the `zerovec` crate +/// This impl requires enabling the optional `serde` Cargo feature of the `zerovec` crate #[cfg(feature = "serde")] impl<'a, K, V> Serialize for ZeroMap<'a, K, V> where @@ -49,7 +49,7 @@ where } } -/// This impl can be made available by enabling the optional `serde` feature of the `zerovec` crate +/// This impl requires enabling the optional `serde` Cargo feature of the `zerovec` crate #[cfg(feature = "serde")] impl<'a, K, V> Serialize for ZeroMapBorrowed<'a, K, V> where @@ -158,7 +158,7 @@ where } } -/// This impl can be made available by enabling the optional `serde` feature of the `zerovec` crate +/// This impl requires enabling the optional `serde` Cargo feature of the `zerovec` crate impl<'de, 'a, K, V> Deserialize<'de> for ZeroMap<'a, K, V> where K: ZeroMapKV<'a> + Ord + ?Sized, @@ -190,7 +190,7 @@ where } } -// /// This impl can be made available by enabling the optional `serde` feature of the `zerovec` crate +// /// This impl requires enabling the optional `serde` Cargo feature of the `zerovec` crate impl<'de, 'a, K, V> Deserialize<'de> for ZeroMapBorrowed<'a, K, V> where K: ZeroMapKV<'a> + Ord + ?Sized, |