From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/zerovec/src/hashmap/mod.rs | 18 ++++++++++-------- vendor/zerovec/src/hashmap/serde.rs | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'vendor/zerovec/src/hashmap') diff --git a/vendor/zerovec/src/hashmap/mod.rs b/vendor/zerovec/src/hashmap/mod.rs index 5d91114ad..e3aed1198 100644 --- a/vendor/zerovec/src/hashmap/mod.rs +++ b/vendor/zerovec/src/hashmap/mod.rs @@ -20,8 +20,8 @@ mod serde; /// ``` /// use zerovec::ZeroHashMap; /// -/// let kv = vec![(0, "a"), (1, "b"), (2, "c")]; -/// let hashmap: ZeroHashMap = ZeroHashMap::from_iter(kv.into_iter()); +/// let hashmap = +/// ZeroHashMap::::from_iter([(0, "a"), (1, "b"), (2, "c")]); /// assert_eq!(hashmap.get(&0), Some("a")); /// assert_eq!(hashmap.get(&2), Some("c")); /// assert_eq!(hashmap.get(&4), None); @@ -91,8 +91,7 @@ where /// ``` /// use zerovec::ZeroHashMap; /// - /// let hashmap: ZeroHashMap = - /// ZeroHashMap::from_iter(vec![("a", "A"), ("z", "Z")].into_iter()); + /// let hashmap = ZeroHashMap::::from_iter([("a", "A"), ("z", "Z")]); /// /// assert_eq!(hashmap.get("a"), Some("A")); /// assert_eq!(hashmap.get("z"), Some("Z")); @@ -111,8 +110,7 @@ where /// ```rust /// use zerovec::ZeroHashMap; /// - /// let hashmap: ZeroHashMap = - /// ZeroHashMap::from_iter(vec![("a", "A"), ("z", "Z")].into_iter()); + /// let hashmap = ZeroHashMap::::from_iter([("a", "A"), ("z", "Z")]); /// /// assert!(hashmap.contains_key("a")); /// assert!(!hashmap.contains_key("p")); @@ -176,8 +174,12 @@ where /// ``` /// use zerovec::ZeroHashMap; /// - /// let kv: Vec<(i32, &str)> = vec![(1, "a"), (2, "b"), (3, "c"), (4, "d")]; - /// let hashmap: ZeroHashMap = ZeroHashMap::from_iter(kv.into_iter()); + /// let hashmap = ZeroHashMap::::from_iter([ + /// (1, "a"), + /// (2, "b"), + /// (3, "c"), + /// (4, "d"), + /// ]); /// assert_eq!(hashmap.get(&1), Some("a")); /// assert_eq!(hashmap.get(&2), Some("b")); /// assert_eq!(hashmap.get(&3), Some("c")); diff --git a/vendor/zerovec/src/hashmap/serde.rs b/vendor/zerovec/src/hashmap/serde.rs index 2d724ac05..7a4941205 100644 --- a/vendor/zerovec/src/hashmap/serde.rs +++ b/vendor/zerovec/src/hashmap/serde.rs @@ -77,7 +77,7 @@ mod test { } fn make_zerohashmap() -> ZeroHashMap<'static, u32, str> { - ZeroHashMap::from_iter(vec![(0, "a"), (1, "b"), (2, "c")].into_iter()) + ZeroHashMap::from_iter([(0, "a"), (1, "b"), (2, "c")]) } fn build_invalid_hashmap_str( -- cgit v1.2.3