Skip to content

Commit 57dcf3c

Browse files
Merge pull request #1296 from mbrobbel/patch-1
Re-apply fix for #199 in ch15-05
2 parents cf7322d + 0f292d4 commit 57dcf3c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

second-edition/src/ch15-05-interior-mutability.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
data even when there are immutable references to that data; normally, this
77
action is disallowed by the borrowing rules. To mutate data, the pattern uses
88
`unsafe` code inside a data structure to bend Rust’s usual rules that govern
9-
mutation and borrowing. We haven’t yet covered unsafe code; we will in Chapter
10-
19. We can use types that use the interior mutability pattern when we can
11-
ensure that the borrowing rules will be followed at runtime, even though the
12-
compiler can’t guarantee that. The `unsafe` code involved is then wrapped in a
13-
safe API, and the outer type is still immutable.
9+
mutation and borrowing. We haven’t yet covered unsafe code; we will in
10+
Chapter 19. We can use types that use the interior mutability pattern when we
11+
can ensure that the borrowing rules will be followed at runtime, even though
12+
the compiler can’t guarantee that. The `unsafe` code involved is then wrapped
13+
in a safe API, and the outer type is still immutable.
1414

1515
Let’s explore this concept by looking at the `RefCell<T>` type that follows the
1616
interior mutability pattern.

0 commit comments

Comments
 (0)