diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-05-24 21:59:56 -0700 |
|---|---|---|
| committer | Richo Healey <richo@psych0tik.net> | 2014-05-26 19:06:13 -0700 |
| commit | c7fe4ffe3d8315dfe98bee6d040b5a0381daab91 (patch) | |
| tree | d005bac35d0a12ce8a17b10f1df692fec845061c | |
| parent | 746d086f9322d24fa7b389dd911e204ca35012ae (diff) | |
| download | rust-c7fe4ffe3d8315dfe98bee6d040b5a0381daab91.tar.gz rust-c7fe4ffe3d8315dfe98bee6d040b5a0381daab91.zip | |
std: Remove String::from_owned_str as it's redundant
[breaking-change]
| -rw-r--r-- | src/libgetopts/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/str.rs | 7 | ||||
| -rw-r--r-- | src/libstd/string.rs | 3 | ||||
| -rw-r--r-- | src/libtest/lib.rs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 2039dcc7d14..85e1a7decc2 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -671,7 +671,7 @@ pub fn usage(brief: &str, opts: &[OptGroup]) -> String { hasarg: hasarg, ..} = (*optref).clone(); - let mut row = String::from_owned_str(" ".repeat(4)); + let mut row = " ".repeat(4); // short option match short_name.len() { diff --git a/src/libstd/str.rs b/src/libstd/str.rs index d68ed099a4a..b57c329983e 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -910,10 +910,9 @@ impl OwnedStr for String { } #[inline] - fn append(self, rhs: &str) -> String { - let mut new_str = String::from_owned_str(self); - new_str.push_str(rhs); - new_str + fn append(mut self, rhs: &str) -> String { + self.push_str(rhs); + self } } diff --git a/src/libstd/string.rs b/src/libstd/string.rs index f4d1e2a1858..8897750df65 100644 --- a/src/libstd/string.rs +++ b/src/libstd/string.rs @@ -68,7 +68,8 @@ impl String { } } - /// Creates a new string buffer from the given owned string, taking care not to copy it. + #[allow(missing_doc)] + #[deprecated = "obsoleted by the removal of ~str"] #[inline] pub fn from_owned_str(string: String) -> String { string diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 89f8d227717..f10f16cc070 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -110,7 +110,7 @@ impl TestDesc { use std::num::Saturating; let mut name = String::from_str(self.name.as_slice()); let fill = column_count.saturating_sub(name.len()); - let mut pad = String::from_owned_str(" ".repeat(fill)); + let mut pad = " ".repeat(fill); match align { PadNone => name, PadOnLeft => { |
