Skip to content

Commit

Permalink
Fix unclear wording in 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
L0uisc committed Apr 9, 2019
1 parent b93ec30 commit 173c445
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ch04-03-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta

Recall from the borrowing rules that if we have an immutable reference to
something, we cannot also take a mutable reference. Because `clear` needs to
truncate the `String`, it tries to take a mutable reference, which fails. Not
only has Rust made our API easier to use, but it has also eliminated an entire
class of errors at compile time!
truncate the `String`, it needs to get a mutable reference, which the compiler
disallows, which fails. Not only has Rust made our API easier to use, but it
has also eliminated an entire class of errors at compile time!

#### String Literals Are Slices

Expand Down

0 comments on commit 173c445

Please sign in to comment.