From 103503b80e748106ef494be22fec96125c0eeb9b Mon Sep 17 00:00:00 2001 From: songhahaha66 Date: Mon, 27 Oct 2025 21:27:08 +0800 Subject: [PATCH] Fix mutable borrow error in borrowing.md example Updated println! macro to only use r1 to avoid mutable borrow error. --- solutions/ownership/borrowing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solutions/ownership/borrowing.md b/solutions/ownership/borrowing.md index 320e78a7..1e814e8a 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 - println!("{}, {}", r1, r2); + println!("{}", r1); } ```