From 1c83c69d3096952c40bf0feab816a2129a9100ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on?= <86625957@qq.com> Date: Wed, 30 Aug 2023 18:48:08 +0800 Subject: [PATCH] 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 --- solutions/ownership/borrowing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/ownership/borrowing.md b/solutions/ownership/borrowing.md index d82d3da86..320e78a7a 100644 --- a/solutions/ownership/borrowing.md +++ b/solutions/ownership/borrowing.md @@ -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 // you can't use r1 and r2 at the same time - r1.push_str("world"); + println!("{}, {}", r1, r2); } -``` \ No newline at end of file +```