From 513d2292e5a743e630ceece06255528c1902ac01 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sat, 8 Jun 2013 18:28:08 +1000 Subject: std: remove foldr and alli methods in vec --- src/libstd/vec.rs | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 7540f54f308..bdc9fd0ccad 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -1821,11 +1821,9 @@ pub trait ImmutableVector<'self, T> { fn last_opt(&self) -> Option<&'self T>; fn position(&self, f: &fn(t: &T) -> bool) -> Option; fn rposition(&self, f: &fn(t: &T) -> bool) -> Option; - fn foldr<'a, U>(&'a self, z: U, p: &fn(t: &'a T, u: U) -> U) -> U; fn map(&self, f: &fn(t: &T) -> U) -> ~[U]; fn mapi(&self, f: &fn(uint, t: &T) -> U) -> ~[U]; fn map_r(&self, f: &fn(x: &T) -> U) -> ~[U]; - fn alli(&self, f: &fn(uint, t: &T) -> bool) -> bool; fn flat_map(&self, f: &fn(t: &T) -> ~[U]) -> ~[U]; fn filter_mapped(&self, f: &fn(t: &T) -> Option) -> ~[U]; unsafe fn unsafe_ref(&self, index: uint) -> *T; @@ -1913,12 +1911,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] { rposition(*self, f) } - /// Reduce a vector from right to left - #[inline] - fn foldr<'a, U>(&'a self, z: U, p: &fn(t: &'a T, u: U) -> U) -> U { - self.rev_iter().fold(z, |u, t| p(t, u)) - } - /// Apply a function to each element of a vector and return the results #[inline] fn map(&self, f: &fn(t: &T) -> U) -> ~[U] { map(*self, f) } @@ -1942,14 +1934,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] { r } - /** - * Returns true if the function returns true for all elements. - * - * If the vector is empty, true is returned. - */ - fn alli(&self, f: &fn(uint, t: &T) -> bool) -> bool { - self.iter().enumerate().all(|(i, t)| f(i,t)) - } /** * Apply a function to each element of a vector and return a concatenation * of each result vector -- cgit 1.4.1-3-g733a5