Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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