From 757acac58a28ebd31824870dfe80aaa67b9d0b1d Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Thu, 21 Mar 2024 20:30:49 -0700 Subject: [PATCH] Simplify lifetimes on extract_from_if() --- src/table.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/table.rs b/src/table.rs index 7884974e..9ff9c7a0 100644 --- a/src/table.rs +++ b/src/table.rs @@ -146,18 +146,13 @@ impl<'txn, K: Key + 'static, V: Value + 'static> Table<'txn, K, V> { /// `predicate` evaluates to `true` are returned in an iterator, and those which are read from the iterator are removed /// /// Note: values not read from the iterator will not be removed - pub fn extract_from_if< - 'a, - 'a0, - KR, - F: for<'f> FnMut(K::SelfType<'f>, V::SelfType<'f>) -> bool, - >( - &'a mut self, - range: impl RangeBounds + 'a0, + pub fn extract_from_if<'a, KR, F: for<'f> FnMut(K::SelfType<'f>, V::SelfType<'f>) -> bool>( + &mut self, + range: impl RangeBounds + 'a, predicate: F, - ) -> Result> + ) -> Result> where - KR: Borrow> + 'a0, + KR: Borrow> + 'a, { self.tree .extract_from_if(&range, predicate)