]> git.lizzy.rs Git - rust.git/commitdiff
Deprecate String::from_str in favor of String::from
authorSimon Sapin <simon.sapin@exyr.org>
Sun, 7 Jun 2015 20:36:58 +0000 (22:36 +0200)
committerSimon Sapin <simon.sapin@exyr.org>
Sun, 7 Jun 2015 20:36:58 +0000 (22:36 +0200)
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical.

src/libcollections/string.rs

index 7edcf3d3c9a209a0d8d6bc374bbf1c0baf18783e..86f77510e47509ff273685766bbde585712e782c 100644 (file)
@@ -93,8 +93,8 @@ pub fn with_capacity(capacity: usize) -> 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()) }