diff options
| author | Ulrik Sverdrup <root@localhost> | 2015-05-19 03:33:17 +0200 |
|---|---|---|
| committer | Ulrik Sverdrup <root@localhost> | 2015-05-19 03:33:17 +0200 |
| commit | 4e4374b7de0beec459f6d9db8e06f2cad0c969e7 (patch) | |
| tree | b0f1e553dc26cdd66b1af1ef233c5dd2fc571abc /src/liballoc | |
| parent | 4daa62a55f906bd7ec7ad265cb23d49d9d0db66a (diff) | |
| download | rust-4e4374b7de0beec459f6d9db8e06f2cad0c969e7.tar.gz rust-4e4374b7de0beec459f6d9db8e06f2cad0c969e7.zip | |
collections: Avoid unstable code in examples for String
Prefer String::from over from_str; String::from_str is unstable while String::from is stable. Promote the latter by using it in examples. Simply migrating unstable function to the closest alternative.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/rc.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 88c5c38172a..1e773b7f206 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -32,7 +32,7 @@ //! and have the `Owner` remain allocated as long as any `Gadget` points at it. //! //! ```rust -//! # #![feature(alloc, collections)] +//! # #![feature(alloc)] //! use std::rc::Rc; //! //! struct Owner { @@ -49,7 +49,7 @@ //! fn main() { //! // Create a reference counted Owner. //! let gadget_owner : Rc<Owner> = Rc::new( -//! Owner { name: String::from_str("Gadget Man") } +//! Owner { name: String::from("Gadget Man") } //! ); //! //! // Create Gadgets belonging to gadget_owner. To increment the reference |
