diff options
Diffstat (limited to 'src/rust/protover')
-rw-r--r-- | src/rust/protover/protoset.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/rust/protover/protoset.rs b/src/rust/protover/protoset.rs index 27c16c7005..465b8f2850 100644 --- a/src/rust/protover/protoset.rs +++ b/src/rust/protover/protoset.rs @@ -242,36 +242,6 @@ impl ProtoSet { false } - /// Retain only the `Version`s in this `ProtoSet` for which the predicate - /// `F` returns `true`. - /// - /// # Examples - /// - /// ``` - /// # use protover::errors::ProtoverError; - /// use protover::protoset::ProtoSet; - /// - /// # fn do_test() -> Result<bool, ProtoverError> { - /// let mut protoset: ProtoSet = "1,3-5,9".parse()?; - /// - /// // Keep only versions less than or equal to 8: - /// protoset.retain(|x| x <= &8); - /// - /// assert_eq!(protoset.expand(), vec![1, 3, 4, 5]); - /// # - /// # Ok(true) - /// # } - /// # fn main() { do_test(); } // wrap the test so we can use the ? operator - /// ``` - // XXX we could probably do something more efficient here. —isis - pub fn retain<F>(&mut self, f: F) - where F: FnMut(&Version) -> bool - { - let mut expanded: Vec<Version> = self.clone().expand(); - expanded.retain(f); - *self = expanded.into(); - } - /// Returns all the `Version`s in `self` which are not also in the `other` /// `ProtoSet`. /// |