From bbb172d4d4ea2d41a637c295edf264bb60277401 Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Wed, 8 Nov 2023 14:20:22 +0000 Subject: [PATCH] Simplify invalidation_set --- src/hugr/rewrite/replace.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/hugr/rewrite/replace.rs b/src/hugr/rewrite/replace.rs index f94bd6f3e..ac250ad60 100644 --- a/src/hugr/rewrite/replace.rs +++ b/src/hugr/rewrite/replace.rs @@ -1,8 +1,7 @@ //! Implementation of the `Replace` operation. -use std::collections::hash_map::Values; use std::collections::{HashMap, HashSet, VecDeque}; -use std::iter::{Chain, Copied, Take}; +use std::iter::Copied; use std::slice::Iter; use itertools::Itertools; @@ -217,12 +216,7 @@ impl Rewrite for Replacement { type ApplyResult = (); - type InvalidationSet<'a> = // as IntoIterator>::IntoIter - Chain< - Chain< - Copied>, - Copied>>, - Copied>>> + type InvalidationSet<'a> = Copied> where Self: 'a; @@ -334,11 +328,7 @@ impl Rewrite for Replacement { } fn invalidation_set(&self) -> Self::InvalidationSet<'_> { - self.removal - .iter() - .copied() - .chain(self.adoptions.values().copied()) - .chain(self.removal.iter().take(1).copied()) + self.removal.iter().copied() } }