diff --git a/maybe_owned_vec.rs b/maybe_owned_vec.rs index 3a89d8b..2c516af 100644 --- a/maybe_owned_vec.rs +++ b/maybe_owned_vec.rs @@ -12,7 +12,7 @@ use std::default::Default; use std::fmt; use std::iter::FromIterator; use std::path::BytesContainer; -use std::slice; +use std::slice::{mod, Permutations}; // Note 1: It is not clear whether the flexibility of providing both // the `Growable` and `FixedLen` variants is sufficiently useful. @@ -137,11 +137,19 @@ impl<'a,T:fmt::Show> fmt::Show for MaybeOwnedVector<'a,T> { } } -impl<'a,T:Clone> CloneableVector for MaybeOwnedVector<'a,T> { +impl<'a,T:Clone> CloneSliceAllocPrelude for MaybeOwnedVector<'a,T> { /// Returns a copy of `self`. fn to_vec(&self) -> Vec { self.as_slice().to_vec() } + + fn partitioned(&self, f: |&T| -> bool) -> (Vec, Vec) { + self.as_slice().partitioned(f) + } + + fn permutations(&self) -> Permutations { + self.as_slice().permutations() + } } impl<'a, T: Clone> Clone for MaybeOwnedVector<'a, T> { @@ -153,7 +161,6 @@ impl<'a, T: Clone> Clone for MaybeOwnedVector<'a, T> { } } - impl<'a, T> Default for MaybeOwnedVector<'a, T> { fn default() -> MaybeOwnedVector<'a, T> { Growable(Vec::new())