diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-09-03 22:06:23 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-09-03 22:08:47 +0200 |
| commit | 355847f5c13be35c12bfe879cadc58d6cbc2798f (patch) | |
| tree | 91f3c2820a7b1ee400e8b1e98761848a5edfa584 /src/liballoc | |
| parent | 1661947014fc2ecbbb7a30b1604499500dcf767e (diff) | |
| download | rust-355847f5c13be35c12bfe879cadc58d6cbc2798f.tar.gz rust-355847f5c13be35c12bfe879cadc58d6cbc2798f.zip | |
doc: reduce indentation of examples to 4 spaces
Also, add trailing commas
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/rc.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index b1fb5be4d21..2f92fb7bac5 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -51,7 +51,7 @@ //! fn main() { //! // Create a reference counted Owner. //! let gadget_owner : Rc<Owner> = Rc::new( -//! Owner { name: String::from("Gadget Man") } +//! Owner { name: String::from("Gadget Man") } //! ); //! //! // Create Gadgets belonging to gadget_owner. To increment the reference @@ -102,13 +102,13 @@ //! //! struct Owner { //! name: String, -//! gadgets: RefCell<Vec<Weak<Gadget>>> +//! gadgets: RefCell<Vec<Weak<Gadget>>>, //! // ...other fields //! } //! //! struct Gadget { //! id: i32, -//! owner: Rc<Owner> +//! owner: Rc<Owner>, //! // ...other fields //! } //! @@ -117,10 +117,10 @@ //! // Owner's vector of Gadgets inside a RefCell so that we can mutate it //! // through a shared reference. //! let gadget_owner : Rc<Owner> = Rc::new( -//! Owner { -//! name: "Gadget Man".to_string(), -//! gadgets: RefCell::new(Vec::new()) -//! } +//! Owner { +//! name: "Gadget Man".to_string(), +//! gadgets: RefCell::new(Vec::new()), +//! } //! ); //! //! // Create Gadgets belonging to gadget_owner as before. |
