From 2ff42435c21289cdc668081446ca349f5eb4323c Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 7 Jun 2015 22:36:58 +0200 Subject: [PATCH] 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. --- src/libcollections/string.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 7edcf3d3c9a..86f77510e47 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -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()) }