doc: reduce indentation of examples to 4 spaces
Also, add trailing commas
This commit is contained in:
parent
1661947014
commit
355847f5c1
1 changed files with 7 additions and 7 deletions
|
@ -51,7 +51,7 @@
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! // Create a reference counted Owner.
|
//! // Create a reference counted Owner.
|
||||||
//! let gadget_owner : Rc<Owner> = Rc::new(
|
//! 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
|
//! // Create Gadgets belonging to gadget_owner. To increment the reference
|
||||||
|
@ -102,13 +102,13 @@
|
||||||
//!
|
//!
|
||||||
//! struct Owner {
|
//! struct Owner {
|
||||||
//! name: String,
|
//! name: String,
|
||||||
//! gadgets: RefCell<Vec<Weak<Gadget>>>
|
//! gadgets: RefCell<Vec<Weak<Gadget>>>,
|
||||||
//! // ...other fields
|
//! // ...other fields
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! struct Gadget {
|
//! struct Gadget {
|
||||||
//! id: i32,
|
//! id: i32,
|
||||||
//! owner: Rc<Owner>
|
//! owner: Rc<Owner>,
|
||||||
//! // ...other fields
|
//! // ...other fields
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
|
@ -117,10 +117,10 @@
|
||||||
//! // Owner's vector of Gadgets inside a RefCell so that we can mutate it
|
//! // Owner's vector of Gadgets inside a RefCell so that we can mutate it
|
||||||
//! // through a shared reference.
|
//! // through a shared reference.
|
||||||
//! let gadget_owner : Rc<Owner> = Rc::new(
|
//! let gadget_owner : Rc<Owner> = Rc::new(
|
||||||
//! Owner {
|
//! Owner {
|
||||||
//! name: "Gadget Man".to_string(),
|
//! name: "Gadget Man".to_string(),
|
||||||
//! gadgets: RefCell::new(Vec::new())
|
//! gadgets: RefCell::new(Vec::new()),
|
||||||
//! }
|
//! }
|
||||||
//! );
|
//! );
|
||||||
//!
|
//!
|
||||||
//! // Create Gadgets belonging to gadget_owner as before.
|
//! // Create Gadgets belonging to gadget_owner as before.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue