fix: Correct the wrong answer to Exercise 11 in Chapter borrowing

Calling only r1 in the new compiler version does not trigger a reborrowing error
This commit is contained in:
Léon
2023-08-30 18:48:08 +08:00
committed by GitHub
parent 722b969100
commit 1c83c69d30

View File

@ -149,6 +149,6 @@ fn main() {
// add one line below to make a compiler error: cannot borrow `s` as mutable more than once at a time // add one line below to make a compiler error: cannot borrow `s` as mutable more than once at a time
// you can't use r1 and r2 at the same time // you can't use r1 and r2 at the same time
r1.push_str("world"); println!("{}, {}", r1, r2);
} }
``` ```