libstd: Implement some convenience methods on vectors
This commit is contained in:
@@ -101,6 +101,7 @@ use to_str::ToStr;
|
||||
use from_str::FromStr;
|
||||
use vec;
|
||||
use vec::{OwnedVector, OwnedCloneableVector, ImmutableVector, MutableVector};
|
||||
use vec_ng::Vec;
|
||||
use default::Default;
|
||||
use to_bytes::{IterBytes, Cb};
|
||||
use unstable::raw::Repr;
|
||||
@@ -222,6 +223,18 @@ impl<'a, S: Str> StrVector for &'a [S] {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, S: Str> StrVector for Vec<S> {
|
||||
#[inline]
|
||||
fn concat(&self) -> ~str {
|
||||
self.as_slice().concat()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn connect(&self, sep: &str) -> ~str {
|
||||
self.as_slice().connect(sep)
|
||||
}
|
||||
}
|
||||
|
||||
/// Something that can be used to compare against a character
|
||||
pub trait CharEq {
|
||||
/// Determine if the splitter should split at the given character
|
||||
|
||||
Reference in New Issue
Block a user