std: Remove String::from_owned_str as it's redundant
[breaking-change]
This commit is contained in:
@@ -671,7 +671,7 @@ pub fn usage(brief: &str, opts: &[OptGroup]) -> String {
|
|||||||
hasarg: hasarg,
|
hasarg: hasarg,
|
||||||
..} = (*optref).clone();
|
..} = (*optref).clone();
|
||||||
|
|
||||||
let mut row = String::from_owned_str(" ".repeat(4));
|
let mut row = " ".repeat(4);
|
||||||
|
|
||||||
// short option
|
// short option
|
||||||
match short_name.len() {
|
match short_name.len() {
|
||||||
|
|||||||
@@ -910,10 +910,9 @@ impl OwnedStr for String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn append(self, rhs: &str) -> String {
|
fn append(mut self, rhs: &str) -> String {
|
||||||
let mut new_str = String::from_owned_str(self);
|
self.push_str(rhs);
|
||||||
new_str.push_str(rhs);
|
self
|
||||||
new_str
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
#[inline]
|
||||||
pub fn from_owned_str(string: String) -> String {
|
pub fn from_owned_str(string: String) -> String {
|
||||||
string
|
string
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ impl TestDesc {
|
|||||||
use std::num::Saturating;
|
use std::num::Saturating;
|
||||||
let mut name = String::from_str(self.name.as_slice());
|
let mut name = String::from_str(self.name.as_slice());
|
||||||
let fill = column_count.saturating_sub(name.len());
|
let fill = column_count.saturating_sub(name.len());
|
||||||
let mut pad = String::from_owned_str(" ".repeat(fill));
|
let mut pad = " ".repeat(fill);
|
||||||
match align {
|
match align {
|
||||||
PadNone => name,
|
PadNone => name,
|
||||||
PadOnLeft => {
|
PadOnLeft => {
|
||||||
|
|||||||
Reference in New Issue
Block a user