From a28c70785d2c0c0455b516d8adc5dd392547ee53 Mon Sep 17 00:00:00 2001 From: James Carl Date: Wed, 6 Mar 2024 17:03:17 -0500 Subject: [PATCH 1/2] Cleanup signatures for new and replace functions --- crates/fj-core/src/objects/object_set.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/objects/object_set.rs b/crates/fj-core/src/objects/object_set.rs index 9f727f144..db9a459e3 100644 --- a/crates/fj-core/src/objects/object_set.rs +++ b/crates/fj-core/src/objects/object_set.rs @@ -28,10 +28,11 @@ impl ObjectSet { /// # Panics /// /// Panics, if the iterator contains duplicate `Handle`s. - pub fn new(handles: impl IntoIterator) -> Self + pub fn new( + handles: impl IntoIterator>>, + ) -> Self where T: Debug + Ord, - H: Into>, { let mut added = BTreeSet::new(); let mut inner = Vec::new(); @@ -150,14 +151,13 @@ impl ObjectSet { /// /// Panics, if the update results in a duplicate item. #[must_use] - pub fn replace( + pub fn replace( &self, original: &Handle, - replacements: impl IntoIterator, + replacements: impl IntoIterator>>, ) -> Option where T: Debug + Ord, - H: Into>, { let mut iter = self.iter().cloned().peekable(); From 45b5814e54e898be7df65d3c8290bf99b94bc70f Mon Sep 17 00:00:00 2001 From: James Carl Date: Wed, 6 Mar 2024 17:05:13 -0500 Subject: [PATCH 2/2] Remove deduplicate_with_hash_set test --- crates/fj-core/src/objects/object_set.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/crates/fj-core/src/objects/object_set.rs b/crates/fj-core/src/objects/object_set.rs index db9a459e3..ed27a6010 100644 --- a/crates/fj-core/src/objects/object_set.rs +++ b/crates/fj-core/src/objects/object_set.rs @@ -268,18 +268,6 @@ mod tests { // shouldn't do that in this case. } - #[test] - fn deduplicate_with_hashset() { - let mut core = Core::new(); - - let bare_cycle = Cycle::new([]); - let cycle = bare_cycle.insert(&mut core); - - let standard_set = HashSet::from([cycle.clone(), cycle.clone()]); - - assert_eq!(standard_set, [cycle].into()); - } - #[test] fn object_set_from_handle_wrappers() { let mut core = Core::new();