Skip to content

Commit beb072a

Browse files
author
Tymoteusz Jankowski
committed
empty lines
1 parent 8286075 commit beb072a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/cell.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,12 @@ use ops::{Deref, DerefMut, CoerceUnsized};
187187
use ptr;
188188

189189
/// A mutable memory location.
190+
///
190191
/// # Examples
192+
///
191193
/// Here you can see how using `Cell<T>` allows to use mutable field inside
192194
/// immutable struct (which is also called 'interior mutability').
195+
///
193196
/// ```
194197
/// use std::cell::Cell;
195198
///
@@ -204,8 +207,10 @@ use ptr;
204207
/// };
205208
///
206209
/// let new_value = 100;
210+
///
207211
/// // ERROR, because my_struct is immutable
208212
/// // immutable.regular_field = new_value;
213+
///
209214
/// // WORKS, although `my_struct` is immutable, field `special_field` is mutable because it is Cell
210215
/// immutable.special_field.set(new_value);
211216
/// assert_eq!(immutable.special_field.get(), new_value);

0 commit comments

Comments
 (0)