1
Fork 0

Deprecate String::from_str in favor of String::from

With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical.
This commit is contained in:
Simon Sapin 2015-06-07 22:36:58 +02:00
parent 64d32b057e
commit 2ff42435c2

View file

@ -93,8 +93,8 @@ impl String {
/// assert_eq!(&s[..], "hello"); /// assert_eq!(&s[..], "hello");
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "collections", #[unstable(feature = "collections", reason = "use `String::from` instead")]
reason = "needs investigation to see if to_string() can match perf")] #[deprecated(since = "1.2.0", reason = "use `String::from` instead")]
#[cfg(not(test))] #[cfg(not(test))]
pub fn from_str(string: &str) -> String { pub fn from_str(string: &str) -> String {
String { vec: <[_]>::to_vec(string.as_bytes()) } String { vec: <[_]>::to_vec(string.as_bytes()) }