Skip to content

Commit

Permalink
Deprecate String::from_str in favor of String::from
Browse files Browse the repository at this point in the history
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical.
  • Loading branch information
SimonSapin committed Jun 7, 2015
1 parent 64d32b0 commit 2ff4243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcollections/string.rs
Expand Up @@ -93,8 +93,8 @@ impl String {
/// assert_eq!(&s[..], "hello");
/// ```
#[inline]
#[unstable(feature = "collections",
reason = "needs investigation to see if to_string() can match perf")]
#[unstable(feature = "collections", reason = "use `String::from` instead")]
#[deprecated(since = "1.2.0", reason = "use `String::from` instead")]
#[cfg(not(test))]
pub fn from_str(string: &str) -> String {
String { vec: <[_]>::to_vec(string.as_bytes()) }
Expand Down

0 comments on commit 2ff4243

Please sign in to comment.