diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2017-01-13 01:57:48 +0100 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2017-01-13 01:57:48 +0100 |
| commit | d5c3becf00452fd1d35e695494d7ae41dedb11d8 (patch) | |
| tree | 3bcc12a08e1317e692612e2478ba7811b08eb281 /src/libcore | |
| parent | e35717814686ea3e3d44a8f5c1c20d1cd50be82a (diff) | |
| download | rust-d5c3becf00452fd1d35e695494d7ae41dedb11d8.tar.gz rust-d5c3becf00452fd1d35e695494d7ae41dedb11d8.zip | |
Change `to_owned` to `to_string` in docs
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/any.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index eb0636e8576..78f3cd5576e 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -101,7 +101,7 @@ pub trait Any: 'static { /// /// fn main() { /// assert_eq!(is_string(&0), false); - /// assert_eq!(is_string(&"cookie monster".to_owned()), true); + /// assert_eq!(is_string(&"cookie monster".to_string()), true); /// } /// ``` #[unstable(feature = "get_type_id", @@ -154,7 +154,7 @@ impl Any { /// /// fn main() { /// is_string(&0); - /// is_string(&"cookie monster".to_owned()); + /// is_string(&"cookie monster".to_string()); /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -188,7 +188,7 @@ impl Any { /// /// fn main() { /// print_if_string(&0); - /// print_if_string(&"cookie monster".to_owned()); + /// print_if_string(&"cookie monster".to_string()); /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -219,7 +219,7 @@ impl Any { /// /// fn main() { /// let mut x = 10u32; - /// let mut s = "starlord".to_owned(); + /// let mut s = "starlord".to_string(); /// /// modify_if_u32(&mut x); /// modify_if_u32(&mut s); @@ -259,7 +259,7 @@ impl Any+Send { /// /// fn main() { /// is_string(&0); - /// is_string(&"cookie monster".to_owned()); + /// is_string(&"cookie monster".to_string()); /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -285,7 +285,7 @@ impl Any+Send { /// /// fn main() { /// print_if_string(&0); - /// print_if_string(&"cookie monster".to_owned()); + /// print_if_string(&"cookie monster".to_string()); /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] @@ -309,7 +309,7 @@ impl Any+Send { /// /// fn main() { /// let mut x = 10u32; - /// let mut s = "starlord".to_owned(); + /// let mut s = "starlord".to_string(); /// /// modify_if_u32(&mut x); /// modify_if_u32(&mut s); @@ -359,7 +359,7 @@ impl TypeId { /// /// fn main() { /// assert_eq!(is_string(&0), false); - /// assert_eq!(is_string(&"cookie monster".to_owned()), true); + /// assert_eq!(is_string(&"cookie monster".to_string()), true); /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] |
