heh
Diffstat (limited to 'src/util.rs')
| -rw-r--r-- | src/util.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.rs b/src/util.rs index 5ae5c1e..b94d249 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1031,16 +1031,16 @@ impl<T: Copy, U: Copy, V: Copy, I: Iterator<Item = (T, U, V)>> FilterBy3<T, U, V } } pub trait FilterBy<T, U>: Iterator { - fn fl(self, f: impl Fn(T) -> bool) -> impl Iterator<Item = (T, U)>; - fn fr(self, f: impl Fn(U) -> bool) -> impl Iterator<Item = (T, U)>; + fn fl(self, f: impl FnMut(T) -> bool) -> impl Iterator<Item = (T, U)>; + fn fr(self, f: impl FnMut(U) -> bool) -> impl Iterator<Item = (T, U)>; } impl<T: Copy, U: Copy, I: Iterator<Item = (T, U)>> FilterBy<T, U> for I { - fn fl(self, f: impl Fn(T) -> bool) -> impl Iterator<Item = (T, U)> { + fn fl(self, mut f: impl FnMut(T) -> bool) -> impl Iterator<Item = (T, U)> { self.filter(move |(x, _)| f(*x)) } - fn fr(self, f: impl Fn(U) -> bool) -> impl Iterator<Item = (T, U)> { + fn fr(self, mut f: impl FnMut(U) -> bool) -> impl Iterator<Item = (T, U)> { self.filter(move |(_, x)| f(*x)) } } |