Skip to content

Commit 2ff4243

Browse files
committed
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.
1 parent 64d32b0 commit 2ff4243

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcollections/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ impl String {
9393
/// assert_eq!(&s[..], "hello");
9494
/// ```
9595
#[inline]
96-
#[unstable(feature = "collections",
97-
reason = "needs investigation to see if to_string() can match perf")]
96+
#[unstable(feature = "collections", reason = "use `String::from` instead")]
97+
#[deprecated(since = "1.2.0", reason = "use `String::from` instead")]
9898
#[cfg(not(test))]
9999
pub fn from_str(string: &str) -> String {
100100
String { vec: <[_]>::to_vec(string.as_bytes()) }

0 commit comments

Comments
 (0)