Skip to content

Commit 355847f

Browse files
committed
doc: reduce indentation of examples to 4 spaces
Also, add trailing commas
1 parent 1661947 commit 355847f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/liballoc/rc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
//! fn main() {
5252
//! // Create a reference counted Owner.
5353
//! let gadget_owner : Rc<Owner> = Rc::new(
54-
//! Owner { name: String::from("Gadget Man") }
54+
//! Owner { name: String::from("Gadget Man") }
5555
//! );
5656
//!
5757
//! // Create Gadgets belonging to gadget_owner. To increment the reference
@@ -102,13 +102,13 @@
102102
//!
103103
//! struct Owner {
104104
//! name: String,
105-
//! gadgets: RefCell<Vec<Weak<Gadget>>>
105+
//! gadgets: RefCell<Vec<Weak<Gadget>>>,
106106
//! // ...other fields
107107
//! }
108108
//!
109109
//! struct Gadget {
110110
//! id: i32,
111-
//! owner: Rc<Owner>
111+
//! owner: Rc<Owner>,
112112
//! // ...other fields
113113
//! }
114114
//!
@@ -117,10 +117,10 @@
117117
//! // Owner's vector of Gadgets inside a RefCell so that we can mutate it
118118
//! // through a shared reference.
119119
//! let gadget_owner : Rc<Owner> = Rc::new(
120-
//! Owner {
121-
//! name: "Gadget Man".to_string(),
122-
//! gadgets: RefCell::new(Vec::new())
123-
//! }
120+
//! Owner {
121+
//! name: "Gadget Man".to_string(),
122+
//! gadgets: RefCell::new(Vec::new()),
123+
//! }
124124
//! );
125125
//!
126126
//! // Create Gadgets belonging to gadget_owner as before.

0 commit comments

Comments
 (0)