diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 23:25:25 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 23:57:03 +1000 |
| commit | ccd0ac59e9a918f3c2a174e31213286dc6867d37 (patch) | |
| tree | 613e9e26394be216bfb2dc56dba0391ca6486545 /src/libstd | |
| parent | 5a711ea7c317ea90f03d5118dbb2e19e1622bc29 (diff) | |
| download | rust-ccd0ac59e9a918f3c2a174e31213286dc6867d37.tar.gz rust-ccd0ac59e9a918f3c2a174e31213286dc6867d37.zip | |
std: remove str::{connect,concat}*.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 6 | ||||
| -rw-r--r-- | src/libstd/str.rs | 17 |
2 files changed, 3 insertions, 20 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 4df07830b23..d62fc8c2cba 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -22,7 +22,7 @@ use iterator::IteratorUtil; use libc; use option::{None, Option, Some}; use str; -use str::StrSlice; +use str::{StrSlice, StrVector}; use to_str::ToStr; use ascii::{AsciiCast, AsciiStr}; use old_iter::BaseIter; @@ -442,7 +442,7 @@ impl ToStr for PosixPath { if self.is_absolute { s += "/"; } - s + str::connect(self.components, "/") + s + self.components.connect("/") } } @@ -629,7 +629,7 @@ impl ToStr for WindowsPath { if self.is_absolute { s += "\\"; } - s + str::connect(self.components, "\\") + s + self.components.connect("\\") } } diff --git a/src/libstd/str.rs b/src/libstd/str.rs index 4766504813d..c820f645490 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -170,18 +170,6 @@ pub fn append(lhs: ~str, rhs: &str) -> ~str { v } -/// Concatenate a vector of strings -pub fn concat(v: &[~str]) -> ~str { v.concat() } - -/// Concatenate a vector of strings -pub fn concat_slices(v: &[&str]) -> ~str { v.concat() } - -/// Concatenate a vector of strings, placing a given separator between each -pub fn connect(v: &[~str], sep: &str) -> ~str { v.connect(sep) } - -/// Concatenate a vector of strings, placing a given separator between each -pub fn connect_slices(v: &[&str], sep: &str) -> ~str { v.connect(sep) } - #[allow(missing_doc)] pub trait StrVector { pub fn concat(&self) -> ~str; @@ -2495,7 +2483,6 @@ mod tests { #[test] fn test_concat() { fn t(v: &[~str], s: &str) { - assert_eq!(concat(v), s.to_str()); assert_eq!(v.concat(), s.to_str()); } t([~"you", ~"know", ~"I'm", ~"no", ~"good"], "youknowI'mnogood"); @@ -2507,7 +2494,6 @@ mod tests { #[test] fn test_connect() { fn t(v: &[~str], sep: &str, s: &str) { - assert_eq!(connect(v, sep), s.to_str()); assert_eq!(v.connect(sep), s.to_str()); } t([~"you", ~"know", ~"I'm", ~"no", ~"good"], @@ -2520,7 +2506,6 @@ mod tests { #[test] fn test_concat_slices() { fn t(v: &[&str], s: &str) { - assert_eq!(concat_slices(v), s.to_str()); assert_eq!(v.concat(), s.to_str()); } t(["you", "know", "I'm", "no", "good"], "youknowI'mnogood"); @@ -2532,7 +2517,6 @@ mod tests { #[test] fn test_connect_slices() { fn t(v: &[&str], sep: &str, s: &str) { - assert_eq!(connect_slices(v, sep), s.to_str()); assert_eq!(v.connect(sep), s.to_str()); } t(["you", "know", "I'm", "no", "good"], @@ -3307,7 +3291,6 @@ mod tests { assert_eq!(lines, ~["", "Märy häd ä little lämb", "", "Little lämb"]); } - #[test] fn test_split_str_iterator() { fn t<'a>(s: &str, sep: &'a str, u: ~[&str]) { |
