From 995415d6fbbc6debbd5c4681b9d25677f5e78e1d Mon Sep 17 00:00:00 2001 From: Skandesh <42321593+Skandesh@users.noreply.github.com> Date: Fri, 22 Jul 2022 17:18:57 +0530 Subject: [PATCH] Update String.md borrow_string() takes in &str so the value won't be moved into it. hence updated the message inside println!() --- solutions/collections/String.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/collections/String.md b/solutions/collections/String.md index f721b12..2729bc7 100644 --- a/solutions/collections/String.md +++ b/solutions/collections/String.md @@ -32,7 +32,7 @@ fn main() { } fn borrow_string(s: &str) { - println!("ownership of \"{}\" is moved here!", s) + println!("ownership of \"{}\" is still with the variable 's', only the reference is passed", s) } ``` @@ -170,4 +170,4 @@ fn main() { println!("Success!") } -``` \ No newline at end of file +```