File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 54
54
//! containers that can be cloned and shared between multiple parties.
55
55
//! Because the contained values may be multiply-aliased, they can
56
56
//! only be borrowed as shared references, not mutable references.
57
- //! Without cells then it would be impossible to mutate data inside of
57
+ //! Without cells it would be impossible to mutate data inside of
58
58
//! shared boxes at all!
59
59
//!
60
60
//! It's very common then to put a `RefCell` inside shared pointer
104
104
//! // Take a reference to the inside of cache cell
105
105
//! let mut cache = self.span_tree_cache.borrow_mut();
106
106
//! if cache.is_some() {
107
- //! return cache.take_unwrap ().clone();
107
+ //! return cache.get_ref ().clone();
108
108
//! }
109
109
//!
110
110
//! let span_tree = self.calc_span_tree();
118
118
//! // This is the major hazard of using `RefCell`.
119
119
//! self.minimum_spanning_tree()
120
120
//! }
121
- //! # fn calc_span_tree(&self) -> Vec<(uint, uint)> { vec!() }
121
+ //! # fn calc_span_tree(&self) -> Vec<(uint, uint)> { vec![] }
122
122
//! }
123
123
//! # fn main() { }
124
124
//! ```
125
125
//!
126
126
//! ## Mutating implementations of `clone`
127
127
//!
128
- //! This is simply a special - bot common - case of the previous:
128
+ //! This is simply a special - but common - case of the previous:
129
129
//! hiding mutability for operations that appear to be immutable.
130
130
//! The `clone` method is expected to not change the source value, and
131
131
//! is declared to take `&self`, not `&mut self`. Therefore any
Original file line number Diff line number Diff line change 14
14
//! Rust Standard Library](../std/index.html). It is the portable glue
15
15
//! between the language and its libraries, defining the intrinsic and
16
16
//! primitive building blocks of all Rust code. It links to no
17
- //! upstream libraries, no system libraries, no libc.
17
+ //! upstream libraries, no system libraries, and no libc.
18
18
//!
19
19
//! The core library is *minimal*: it isn't even aware of heap allocation,
20
20
//! nor does it provide concurrency or I/O. These things require
21
- //! platform integration, and this library is platform-oblivious .
21
+ //! platform integration, and this library is platform-agnostic .
22
22
//!
23
23
//! *It is not recommended to use the core library*. The stable
24
24
//! functionality of libcore is reexported from the
Original file line number Diff line number Diff line change 16
16
//!
17
17
//! ## Intrinsic types and operations
18
18
//!
19
- //! The [`ptr`](../core/ptr/index.html), [`mem`](../core/mem/index.html),
19
+ //! The [`ptr`](../core/ptr/index.html) and [`mem`](../core/mem/index.html)
20
20
//! modules deal with unsafe pointers and memory manipulation.
21
21
//! [`kinds`](../core/kinds/index.html) defines the special built-in traits,
22
22
//! and [`raw`](../core/raw/index.html) the runtime representation of Rust types.
You can’t perform that action at this time.
0 commit comments