about summary refs log tree commit diff
path: root/src/libstd/vec.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/vec.rs')
-rw-r--r--src/libstd/vec.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 5fbf03c3cbb..0b08f9d00fa 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -222,7 +222,7 @@ pub fn build<A>(size: Option<uint>, builder: |push: |v: A||) -> ~[A] {
 pub struct SplitIterator<'self, T> {
     priv v: &'self [T],
     priv n: uint,
-    priv pred: &'self fn(t: &T) -> bool,
+    priv pred: 'self |t: &T| -> bool,
     priv finished: bool
 }
 
@@ -271,7 +271,7 @@ impl<'self, T> Iterator<&'self [T]> for SplitIterator<'self, T> {
 pub struct RSplitIterator<'self, T> {
     priv v: &'self [T],
     priv n: uint,
-    priv pred: &'self fn(t: &T) -> bool,
+    priv pred: 'self |t: &T| -> bool,
     priv finished: bool
 }
 
@@ -859,20 +859,20 @@ pub trait ImmutableVector<'self, T> {
     fn rev_iter(self) -> RevIterator<'self, T>;
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred`.
-    fn split(self, pred: &'self fn(&T) -> bool) -> SplitIterator<'self, T>;
+    fn split(self, pred: 'self |&T| -> bool) -> SplitIterator<'self, T>;
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred`, limited to splitting
     /// at most `n` times.
-    fn splitn(self, n: uint, pred: &'self fn(&T) -> bool) -> SplitIterator<'self, T>;
+    fn splitn(self, n: uint, pred: |&T| -> bool) -> SplitIterator<'self, T>;
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred`. This starts at the
     /// end of the vector and works backwards.
-    fn rsplit(self, pred: &'self fn(&T) -> bool) -> RSplitIterator<'self, T>;
+    fn rsplit(self, pred: |&T| -> bool) -> RSplitIterator<'self, T>;
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred` limited to splitting
     /// at most `n` times. This starts at the end of the vector and
     /// works backwards.
-    fn rsplitn(self,  n: uint, pred: &'self fn(&T) -> bool) -> RSplitIterator<'self, T>;
+    fn rsplitn(self,  n: uint, pred: 'self |&T| -> bool) -> RSplitIterator<'self, T>;
 
     /**
      * Returns an iterator over all contiguous windows of length
@@ -1024,12 +1024,12 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
     }
 
     #[inline]
-    fn split(self, pred: &'self fn(&T) -> bool) -> SplitIterator<'self, T> {
+    fn split(self, pred: 'self |&T| -> bool) -> SplitIterator<'self, T> {
         self.splitn(uint::max_value, pred)
     }
 
     #[inline]
-    fn splitn(self, n: uint, pred: &'self fn(&T) -> bool) -> SplitIterator<'self, T> {
+    fn splitn(self, n: uint, pred: 'self |&T| -> bool) -> SplitIterator<'self, T> {
         SplitIterator {
             v: self,
             n: n,
@@ -1039,12 +1039,12 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
     }
 
     #[inline]
-    fn rsplit(self, pred: &'self fn(&T) -> bool) -> RSplitIterator<'self, T> {
+    fn rsplit(self, pred: 'self |&T| -> bool) -> RSplitIterator<'self, T> {
         self.rsplitn(uint::max_value, pred)
     }
 
     #[inline]
-    fn rsplitn(self, n: uint, pred: &'self fn(&T) -> bool) -> RSplitIterator<'self, T> {
+    fn rsplitn(self, n: uint, pred: 'self |&T| -> bool) -> RSplitIterator<'self, T> {
         RSplitIterator {
             v: self,
             n: n,