From 4e4374b7de0beec459f6d9db8e06f2cad0c969e7 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Tue, 19 May 2015 03:33:17 +0200 Subject: 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. --- src/liballoc/rc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/liballoc') 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 = 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 -- cgit 1.4.1-3-g733a5