From df0703a982787bd285cf240587024b62de89b018 Mon Sep 17 00:00:00 2001 From: g4titanx Date: Wed, 31 Jul 2024 12:30:06 +0100 Subject: [PATCH 1/4] impl clone for iter/values/keys of storage types --- near-sdk/src/store/free_list/iter.rs | 12 ++++++++ near-sdk/src/store/iterable_map/iter.rs | 14 +++++++++ near-sdk/src/store/iterable_set/iter.rs | 11 +++++++ near-sdk/src/store/tree_map/iter.rs | 14 +++++++++ near-sdk/src/store/unordered_map/iter.rs | 38 ++++++++++++++++++++++++ near-sdk/src/store/unordered_set/iter.rs | 11 +++++++ near-sdk/src/store/vec/iter.rs | 12 ++++++++ 7 files changed, 112 insertions(+) diff --git a/near-sdk/src/store/free_list/iter.rs b/near-sdk/src/store/free_list/iter.rs index c8208bfa8..16003c275 100644 --- a/near-sdk/src/store/free_list/iter.rs +++ b/near-sdk/src/store/free_list/iter.rs @@ -89,6 +89,18 @@ where } } +impl<'a, T> Clone for Iter<'a, T> +where + T: BorshDeserialize + BorshSerialize + Clone, +{ + fn clone(&self) -> Self { + Self { + values: self.values.clone(), + elements_left: self.elements_left, + } + } +} + impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} diff --git a/near-sdk/src/store/iterable_map/iter.rs b/near-sdk/src/store/iterable_map/iter.rs index 549e8df2b..6e3f45d11 100644 --- a/near-sdk/src/store/iterable_map/iter.rs +++ b/near-sdk/src/store/iterable_map/iter.rs @@ -88,6 +88,20 @@ where } } +impl<'a, K, V, H> Clone for Iter<'a, K, V, H> +where + K: BorshSerialize + Ord + BorshDeserialize + Clone, + V: BorshSerialize + BorshDeserialize, + H: ToKey, +{ + fn clone(&self) -> Self { + Self { + keys: self.keys.clone(), + values: self.values, + } + } +} + impl<'a, K, V, H> ExactSizeIterator for Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, diff --git a/near-sdk/src/store/iterable_set/iter.rs b/near-sdk/src/store/iterable_set/iter.rs index 6e551570b..6985bd892 100644 --- a/near-sdk/src/store/iterable_set/iter.rs +++ b/near-sdk/src/store/iterable_set/iter.rs @@ -66,6 +66,17 @@ where } } +impl<'a, T> Clone for Iter<'a, T> +where + T: BorshSerialize + Ord + BorshDeserialize, +{ + fn clone(&self) -> Self { + Self { + elements: self.elements.clone(), + } + } +} + impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} diff --git a/near-sdk/src/store/tree_map/iter.rs b/near-sdk/src/store/tree_map/iter.rs index 05778b82a..c4c4bdcd7 100644 --- a/near-sdk/src/store/tree_map/iter.rs +++ b/near-sdk/src/store/tree_map/iter.rs @@ -89,6 +89,20 @@ where } } +impl<'a, K, V, H> Clone for Iter<'a, K, V, H> +where + K: BorshSerialize + Ord + BorshDeserialize + Clone, + V: BorshSerialize + BorshDeserialize, + H: ToKey, +{ + fn clone(&self) -> Self { + Self { + keys: self.keys.clone(), + values: self.values, + } + } +} + impl<'a, K, V, H> ExactSizeIterator for Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, diff --git a/near-sdk/src/store/unordered_map/iter.rs b/near-sdk/src/store/unordered_map/iter.rs index 42199ea5d..c607612b6 100644 --- a/near-sdk/src/store/unordered_map/iter.rs +++ b/near-sdk/src/store/unordered_map/iter.rs @@ -87,6 +87,20 @@ where } } +impl<'a, K, V, H> Clone for Iter<'a, K, V, H> +where + K: BorshSerialize + Ord + BorshDeserialize + Clone, + V: BorshSerialize + BorshDeserialize, + H: ToKey, +{ + fn clone(&self) -> Self { + Self { + keys: self.keys.clone(), + values: self.values, + } + } +} + impl<'a, K, V, H> ExactSizeIterator for Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, @@ -262,6 +276,17 @@ where } } +impl<'a, K> Clone for Keys<'a, K> +where + K: BorshSerialize + BorshDeserialize + Clone, +{ + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + } + } +} + impl<'a, K> ExactSizeIterator for Keys<'a, K> where K: BorshSerialize + BorshDeserialize {} impl<'a, K> FusedIterator for Keys<'a, K> where K: BorshSerialize + BorshDeserialize {} @@ -322,6 +347,19 @@ where } } +impl<'a, K, V, H> Clone for Values<'a, K, V, H> +where + K: BorshSerialize + Ord + BorshDeserialize + Clone, + V: BorshSerialize + BorshDeserialize + Clone, + H: ToKey, +{ + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + } + } +} + impl<'a, K, V, H> ExactSizeIterator for Values<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, diff --git a/near-sdk/src/store/unordered_set/iter.rs b/near-sdk/src/store/unordered_set/iter.rs index 321df6d96..abae3b592 100644 --- a/near-sdk/src/store/unordered_set/iter.rs +++ b/near-sdk/src/store/unordered_set/iter.rs @@ -66,6 +66,17 @@ where } } +impl<'a, T> Clone for Iter<'a, T> +where + T: BorshSerialize + Ord + BorshDeserialize + Clone, +{ + fn clone(&self) -> Self { + Self { + elements: self.elements.clone(), + } + } +} + impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} diff --git a/near-sdk/src/store/vec/iter.rs b/near-sdk/src/store/vec/iter.rs index ba39a1de2..2de1cad00 100644 --- a/near-sdk/src/store/vec/iter.rs +++ b/near-sdk/src/store/vec/iter.rs @@ -55,6 +55,18 @@ where } } +impl<'a, T> Clone for Iter<'a, T> +where + T: BorshSerialize + BorshDeserialize +{ + fn clone(&self) -> Self { + Self { + vec: self.vec, + range: self.range.clone(), + } + } +} + impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} From b34d6bc117c44e041ae8969f4aed4c3ad1be996c Mon Sep 17 00:00:00 2001 From: g4titanx Date: Wed, 31 Jul 2024 12:43:33 +0100 Subject: [PATCH 2/4] fix clippy issues --- near-sdk/src/store/free_list/iter.rs | 5 +---- near-sdk/src/store/iterable_map/iter.rs | 5 +---- near-sdk/src/store/iterable_set/iter.rs | 4 +--- near-sdk/src/store/tree_map/iter.rs | 5 +---- near-sdk/src/store/unordered_map/iter.rs | 13 +++---------- near-sdk/src/store/unordered_set/iter.rs | 4 +--- near-sdk/src/store/vec/iter.rs | 11 ++++------- 7 files changed, 12 insertions(+), 35 deletions(-) diff --git a/near-sdk/src/store/free_list/iter.rs b/near-sdk/src/store/free_list/iter.rs index 16003c275..82e5389eb 100644 --- a/near-sdk/src/store/free_list/iter.rs +++ b/near-sdk/src/store/free_list/iter.rs @@ -94,10 +94,7 @@ where T: BorshDeserialize + BorshSerialize + Clone, { fn clone(&self) -> Self { - Self { - values: self.values.clone(), - elements_left: self.elements_left, - } + Self { values: self.values.clone(), elements_left: self.elements_left } } } diff --git a/near-sdk/src/store/iterable_map/iter.rs b/near-sdk/src/store/iterable_map/iter.rs index 6e3f45d11..aa7e771dc 100644 --- a/near-sdk/src/store/iterable_map/iter.rs +++ b/near-sdk/src/store/iterable_map/iter.rs @@ -95,10 +95,7 @@ where H: ToKey, { fn clone(&self) -> Self { - Self { - keys: self.keys.clone(), - values: self.values, - } + Self { keys: self.keys.clone(), values: self.values } } } diff --git a/near-sdk/src/store/iterable_set/iter.rs b/near-sdk/src/store/iterable_set/iter.rs index 6985bd892..2800f38b6 100644 --- a/near-sdk/src/store/iterable_set/iter.rs +++ b/near-sdk/src/store/iterable_set/iter.rs @@ -71,9 +71,7 @@ where T: BorshSerialize + Ord + BorshDeserialize, { fn clone(&self) -> Self { - Self { - elements: self.elements.clone(), - } + Self { elements: self.elements.clone() } } } diff --git a/near-sdk/src/store/tree_map/iter.rs b/near-sdk/src/store/tree_map/iter.rs index c4c4bdcd7..8027b296e 100644 --- a/near-sdk/src/store/tree_map/iter.rs +++ b/near-sdk/src/store/tree_map/iter.rs @@ -96,10 +96,7 @@ where H: ToKey, { fn clone(&self) -> Self { - Self { - keys: self.keys.clone(), - values: self.values, - } + Self { keys: self.keys.clone(), values: self.values } } } diff --git a/near-sdk/src/store/unordered_map/iter.rs b/near-sdk/src/store/unordered_map/iter.rs index c607612b6..76c0a6c47 100644 --- a/near-sdk/src/store/unordered_map/iter.rs +++ b/near-sdk/src/store/unordered_map/iter.rs @@ -94,10 +94,7 @@ where H: ToKey, { fn clone(&self) -> Self { - Self { - keys: self.keys.clone(), - values: self.values, - } + Self { keys: self.keys.clone(), values: self.values } } } @@ -281,9 +278,7 @@ where K: BorshSerialize + BorshDeserialize + Clone, { fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - } + Self { inner: self.inner.clone() } } } @@ -354,9 +349,7 @@ where H: ToKey, { fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - } + Self { inner: self.inner.clone() } } } diff --git a/near-sdk/src/store/unordered_set/iter.rs b/near-sdk/src/store/unordered_set/iter.rs index abae3b592..68cbc1f45 100644 --- a/near-sdk/src/store/unordered_set/iter.rs +++ b/near-sdk/src/store/unordered_set/iter.rs @@ -71,9 +71,7 @@ where T: BorshSerialize + Ord + BorshDeserialize + Clone, { fn clone(&self) -> Self { - Self { - elements: self.elements.clone(), - } + Self { elements: self.elements.clone() } } } diff --git a/near-sdk/src/store/vec/iter.rs b/near-sdk/src/store/vec/iter.rs index 2de1cad00..e82ee7747 100644 --- a/near-sdk/src/store/vec/iter.rs +++ b/near-sdk/src/store/vec/iter.rs @@ -55,15 +55,12 @@ where } } -impl<'a, T> Clone for Iter<'a, T> -where - T: BorshSerialize + BorshDeserialize +impl<'a, T> Clone for Iter<'a, T> +where + T: BorshSerialize + BorshDeserialize, { fn clone(&self) -> Self { - Self { - vec: self.vec, - range: self.range.clone(), - } + Self { vec: self.vec, range: self.range.clone() } } } From 427b5be5a785851a3f30391ad1c20f87a91d7435 Mon Sep 17 00:00:00 2001 From: g4titanx Date: Thu, 1 Aug 2024 13:51:59 +0100 Subject: [PATCH 3/4] include test for unordered_map --- near-sdk/src/store/free_list/iter.rs | 10 +-- near-sdk/src/store/free_list/mod.rs | 2 +- near-sdk/src/store/iterable_map/iter.rs | 12 +--- near-sdk/src/store/iterable_set/iter.rs | 10 +-- near-sdk/src/store/tree_map/iter.rs | 14 +---- near-sdk/src/store/unordered_map/iter.rs | 78 ++++++++++++++---------- near-sdk/src/store/unordered_set/iter.rs | 10 +-- near-sdk/src/store/vec/iter.rs | 11 +--- 8 files changed, 56 insertions(+), 91 deletions(-) diff --git a/near-sdk/src/store/free_list/iter.rs b/near-sdk/src/store/free_list/iter.rs index 82e5389eb..844ad73f3 100644 --- a/near-sdk/src/store/free_list/iter.rs +++ b/near-sdk/src/store/free_list/iter.rs @@ -34,6 +34,7 @@ fn decrement_count(count: &mut u32) { } /// An iterator over elements in the storage bucket. This only yields the occupied entries. +#[derive(Clone)] pub struct Iter<'a, T> where T: BorshDeserialize + BorshSerialize, @@ -89,15 +90,6 @@ where } } -impl<'a, T> Clone for Iter<'a, T> -where - T: BorshDeserialize + BorshSerialize + Clone, -{ - fn clone(&self) -> Self { - Self { values: self.values.clone(), elements_left: self.elements_left } - } -} - impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} diff --git a/near-sdk/src/store/free_list/mod.rs b/near-sdk/src/store/free_list/mod.rs index 3c5513d04..ccffe758a 100644 --- a/near-sdk/src/store/free_list/mod.rs +++ b/near-sdk/src/store/free_list/mod.rs @@ -34,7 +34,7 @@ where } #[near(inside_nearsdk)] -#[derive(Debug)] +#[derive(Debug, Clone)] enum Slot { /// Represents a filled cell of a value in the collection. Occupied(T), diff --git a/near-sdk/src/store/iterable_map/iter.rs b/near-sdk/src/store/iterable_map/iter.rs index aa7e771dc..8eb784c4b 100644 --- a/near-sdk/src/store/iterable_map/iter.rs +++ b/near-sdk/src/store/iterable_map/iter.rs @@ -37,6 +37,7 @@ where /// An iterator over elements of a [`IterableMap`]. /// /// This `struct` is created by the `iter` method on [`IterableMap`]. +#[derive(Clone)] pub struct Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize, @@ -88,17 +89,6 @@ where } } -impl<'a, K, V, H> Clone for Iter<'a, K, V, H> -where - K: BorshSerialize + Ord + BorshDeserialize + Clone, - V: BorshSerialize + BorshDeserialize, - H: ToKey, -{ - fn clone(&self) -> Self { - Self { keys: self.keys.clone(), values: self.values } - } -} - impl<'a, K, V, H> ExactSizeIterator for Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, diff --git a/near-sdk/src/store/iterable_set/iter.rs b/near-sdk/src/store/iterable_set/iter.rs index 2800f38b6..db45d5460 100644 --- a/near-sdk/src/store/iterable_set/iter.rs +++ b/near-sdk/src/store/iterable_set/iter.rs @@ -24,6 +24,7 @@ where /// See its documentation for more. /// /// [`iter`]: IterableSet::iter +#[derive(Clone)] pub struct Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize, @@ -66,15 +67,6 @@ where } } -impl<'a, T> Clone for Iter<'a, T> -where - T: BorshSerialize + Ord + BorshDeserialize, -{ - fn clone(&self) -> Self { - Self { elements: self.elements.clone() } - } -} - impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} diff --git a/near-sdk/src/store/tree_map/iter.rs b/near-sdk/src/store/tree_map/iter.rs index 8027b296e..629cdd3da 100644 --- a/near-sdk/src/store/tree_map/iter.rs +++ b/near-sdk/src/store/tree_map/iter.rs @@ -40,6 +40,7 @@ where /// An iterator over elements of a [`TreeMap`], in sorted order. /// /// This `struct` is created by the `iter` method on [`TreeMap`]. +#[derive(Clone)] pub struct Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize, @@ -89,17 +90,6 @@ where } } -impl<'a, K, V, H> Clone for Iter<'a, K, V, H> -where - K: BorshSerialize + Ord + BorshDeserialize + Clone, - V: BorshSerialize + BorshDeserialize, - H: ToKey, -{ - fn clone(&self) -> Self { - Self { keys: self.keys.clone(), values: self.values } - } -} - impl<'a, K, V, H> ExactSizeIterator for Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, @@ -419,6 +409,7 @@ where /// An iterator over the keys of a [`TreeMap`], in sorted order. /// /// This `struct` is created by the `keys` method on [`TreeMap`]. +#[derive(Clone)] pub struct Keys<'a, K: 'a> where K: BorshSerialize + BorshDeserialize + Ord, @@ -687,6 +678,7 @@ where /// An iterator over the values of a [`TreeMap`], in order by key. /// /// This `struct` is created by the `values` method on [`TreeMap`]. +#[derive(Clone)] pub struct Values<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize, diff --git a/near-sdk/src/store/unordered_map/iter.rs b/near-sdk/src/store/unordered_map/iter.rs index 76c0a6c47..1e05f4d63 100644 --- a/near-sdk/src/store/unordered_map/iter.rs +++ b/near-sdk/src/store/unordered_map/iter.rs @@ -36,6 +36,7 @@ where /// An iterator over elements of a [`UnorderedMap`]. /// /// This `struct` is created by the `iter` method on [`UnorderedMap`]. +#[derive(Clone)] pub struct Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize, @@ -87,17 +88,6 @@ where } } -impl<'a, K, V, H> Clone for Iter<'a, K, V, H> -where - K: BorshSerialize + Ord + BorshDeserialize + Clone, - V: BorshSerialize + BorshDeserialize, - H: ToKey, -{ - fn clone(&self) -> Self { - Self { keys: self.keys.clone(), values: self.values } - } -} - impl<'a, K, V, H> ExactSizeIterator for Iter<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, @@ -233,6 +223,7 @@ where /// An iterator over the keys of a [`UnorderedMap`]. /// /// This `struct` is created by the `keys` method on [`UnorderedMap`]. +#[derive(Clone)] pub struct Keys<'a, K: 'a> where K: BorshSerialize + BorshDeserialize, @@ -273,15 +264,6 @@ where } } -impl<'a, K> Clone for Keys<'a, K> -where - K: BorshSerialize + BorshDeserialize + Clone, -{ - fn clone(&self) -> Self { - Self { inner: self.inner.clone() } - } -} - impl<'a, K> ExactSizeIterator for Keys<'a, K> where K: BorshSerialize + BorshDeserialize {} impl<'a, K> FusedIterator for Keys<'a, K> where K: BorshSerialize + BorshDeserialize {} @@ -297,6 +279,7 @@ where /// An iterator over the values of a [`UnorderedMap`]. /// /// This `struct` is created by the `values` method on [`UnorderedMap`]. +#[derive(Clone)] pub struct Values<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize, @@ -342,17 +325,6 @@ where } } -impl<'a, K, V, H> Clone for Values<'a, K, V, H> -where - K: BorshSerialize + Ord + BorshDeserialize + Clone, - V: BorshSerialize + BorshDeserialize + Clone, - H: ToKey, -{ - fn clone(&self) -> Self { - Self { inner: self.inner.clone() } - } -} - impl<'a, K, V, H> ExactSizeIterator for Values<'a, K, V, H> where K: BorshSerialize + Ord + BorshDeserialize + Clone, @@ -552,3 +524,47 @@ where Some(self.remove_value(key)) } } + +#[cfg(test)] +mod tests { + use super::*; + use borsh::{BorshDeserialize, BorshSerialize}; + + #[derive(BorshSerialize, BorshDeserialize, Ord, PartialOrd, Eq, PartialEq, Debug, Clone)] + struct Key(i32); + + #[derive(BorshSerialize, BorshDeserialize, Debug, Clone)] + struct Value(String); + + #[test] + fn test_unordered_map_iter_clone() { + let mut store = UnorderedMap::new(b'a'); + + store.insert(Key(1), Value("one".to_string())); + store.insert(Key(2), Value("two".to_string())); + store.insert(Key(3), Value("three".to_string())); + + let mut iter = store.iter().cycle(); + + let mut collected = vec![]; + for _ in 0..9 { + if let Some((key, value)) = iter.next() { + collected.push((key.clone(), value.clone())); + } + } + + let expected = vec![ + (Key(1), Value("one".to_string())), + (Key(2), Value("two".to_string())), + (Key(3), Value("three".to_string())), + (Key(1), Value("one".to_string())), + (Key(2), Value("two".to_string())), + (Key(3), Value("three".to_string())), + (Key(1), Value("one".to_string())), + (Key(2), Value("two".to_string())), + (Key(3), Value("three".to_string())), + ]; + + assert_eq!(collected, expected); + } +} \ No newline at end of file diff --git a/near-sdk/src/store/unordered_set/iter.rs b/near-sdk/src/store/unordered_set/iter.rs index 68cbc1f45..a31dab95d 100644 --- a/near-sdk/src/store/unordered_set/iter.rs +++ b/near-sdk/src/store/unordered_set/iter.rs @@ -24,6 +24,7 @@ where /// See its documentation for more. /// /// [`iter`]: UnorderedSet::iter +#[derive(Clone)] pub struct Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize, @@ -66,15 +67,6 @@ where } } -impl<'a, T> Clone for Iter<'a, T> -where - T: BorshSerialize + Ord + BorshDeserialize + Clone, -{ - fn clone(&self) -> Self { - Self { elements: self.elements.clone() } - } -} - impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + Ord + BorshDeserialize {} diff --git a/near-sdk/src/store/vec/iter.rs b/near-sdk/src/store/vec/iter.rs index e82ee7747..cbb7da783 100644 --- a/near-sdk/src/store/vec/iter.rs +++ b/near-sdk/src/store/vec/iter.rs @@ -5,7 +5,7 @@ use super::{Vector, ERR_INDEX_OUT_OF_BOUNDS}; use crate::env; /// An iterator over references to each element in the stored vector. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct Iter<'a, T> where T: BorshSerialize + BorshDeserialize, @@ -55,15 +55,6 @@ where } } -impl<'a, T> Clone for Iter<'a, T> -where - T: BorshSerialize + BorshDeserialize, -{ - fn clone(&self) -> Self { - Self { vec: self.vec, range: self.range.clone() } - } -} - impl<'a, T> ExactSizeIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} impl<'a, T> FusedIterator for Iter<'a, T> where T: BorshSerialize + BorshDeserialize {} From fd453cddd5483ada8d8c82312d388c9371dd38c8 Mon Sep 17 00:00:00 2001 From: g4titanx Date: Mon, 5 Aug 2024 09:38:25 +0100 Subject: [PATCH 4/4] fix ci errors --- near-sdk/src/store/unordered_map/iter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/near-sdk/src/store/unordered_map/iter.rs b/near-sdk/src/store/unordered_map/iter.rs index e1ee80c1c..7d28c6c42 100644 --- a/near-sdk/src/store/unordered_map/iter.rs +++ b/near-sdk/src/store/unordered_map/iter.rs @@ -533,7 +533,7 @@ mod tests { #[derive(BorshSerialize, BorshDeserialize, Ord, PartialOrd, Eq, PartialEq, Debug, Clone)] struct Key(i32); - #[derive(BorshSerialize, BorshDeserialize, Debug, Clone)] + #[derive(BorshSerialize, BorshDeserialize, Debug, Clone, PartialEq)] struct Value(String); #[test]