diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index bf3fd8166c28..e84ec40f7a9a 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -1756,6 +1756,7 @@ pub trait OwnedVector { fn swap_remove(&mut self, index: uint) -> T; fn truncate(&mut self, newlen: uint); fn retain(&mut self, f: pure fn(t: &T) -> bool); + fn consume(self, f: fn(uint, v: T)); } impl ~[T]: OwnedVector { @@ -1809,6 +1810,10 @@ impl ~[T]: OwnedVector { retain(self, f); } + #[inline] + fn consume(self, f: fn(uint, v: T)) { + consume(self, f) + } } pub trait OwnedCopyableVector {