mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
Update String.md
borrow_string() takes in &str so the value won't be moved into it. hence updated the message inside println!()
This commit is contained in:
@ -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!")
|
||||
}
|
||||
```
|
||||
```
|
||||
|
Reference in New Issue
Block a user