diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-08 18:28:08 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-09 02:22:23 +1000 |
| commit | 513d2292e5a743e630ceece06255528c1902ac01 (patch) | |
| tree | 2bfd6a023b397d60a5923a66cdcb47241ac1b043 /src/libstd | |
| parent | ed299af62566a9f0f285e81408aab5f7680ab4cc (diff) | |
| download | rust-513d2292e5a743e630ceece06255528c1902ac01.tar.gz rust-513d2292e5a743e630ceece06255528c1902ac01.zip | |
std: remove foldr and alli methods in vec
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/vec.rs | 16 |
1 files changed, 0 insertions, 16 deletions
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<uint>; fn rposition(&self, f: &fn(t: &T) -> bool) -> Option<uint>; - fn foldr<'a, U>(&'a self, z: U, p: &fn(t: &'a T, u: U) -> U) -> U; fn map<U>(&self, f: &fn(t: &T) -> U) -> ~[U]; fn mapi<U>(&self, f: &fn(uint, t: &T) -> U) -> ~[U]; fn map_r<U>(&self, f: &fn(x: &T) -> U) -> ~[U]; - fn alli(&self, f: &fn(uint, t: &T) -> bool) -> bool; fn flat_map<U>(&self, f: &fn(t: &T) -> ~[U]) -> ~[U]; fn filter_mapped<U:Copy>(&self, f: &fn(t: &T) -> Option<U>) -> ~[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<U>(&self, f: &fn(t: &T) -> U) -> ~[U] { map(*self, f) } @@ -1943,14 +1935,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] { } /** - * 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 */ |
