summary refs log tree commit diff
path: root/src/libgraphviz
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-11-02 17:04:32 -0800
committerAaron Turon <aturon@mozilla.com>2014-11-06 08:03:18 -0800
commitcfafc1b7377d34d8c60db7cd386836d39b80af41 (patch)
treefc5490eb766f91db85f6fa6061a48efd23f0457e /src/libgraphviz
parente84e7a00ddec76570bbaa9afea385d544f616814 (diff)
downloadrust-cfafc1b7377d34d8c60db7cd386836d39b80af41.tar.gz
rust-cfafc1b7377d34d8c60db7cd386836d39b80af41.zip
Prelude: rename and consolidate extension traits
This commit renames a number of extension traits for slices and string
slices, now that they have been refactored for DST. In many cases,
multiple extension traits could now be consolidated. Further
consolidation will be possible with generalized where clauses.

The renamings are consistent with the [new `-Prelude`
suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably
a few more candidates for being renamed this way, but that is left for
API stabilization of the relevant modules.

Because this renames traits, it is a:

[breaking-change]

However, I do not expect any code that currently uses the standard
library to actually break.

Closes #17917
Diffstat (limited to 'src/libgraphviz')
-rw-r--r--src/libgraphviz/maybe_owned_vec.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libgraphviz/maybe_owned_vec.rs b/src/libgraphviz/maybe_owned_vec.rs
index 3a89d8b3f81..2c516affeb2 100644
--- a/src/libgraphviz/maybe_owned_vec.rs
+++ b/src/libgraphviz/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<T> for MaybeOwnedVector<'a,T> {
+impl<'a,T:Clone> CloneSliceAllocPrelude<T> for MaybeOwnedVector<'a,T> {
     /// Returns a copy of `self`.
     fn to_vec(&self) -> Vec<T> {
         self.as_slice().to_vec()
     }
+
+    fn partitioned(&self, f: |&T| -> bool) -> (Vec<T>, Vec<T>) {
+        self.as_slice().partitioned(f)
+    }
+
+    fn permutations(&self) -> Permutations<T> {
+        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())