Created
July 12, 2022 07:32
-
-
Save hkulekci/29ceed605b4e09d744e9d9879b4c3b85 to your computer and use it in GitHub Desktop.
What is the mean of "value borrowed here after move"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn run() { | |
// Correct One | |
let hello1 = "Hello"; | |
let mut hello2 = String::from("Hello"); | |
hello2.push('\u{1f600}'); | |
println!("{}", hello1.len()); | |
println!("{}", hello2.len()); | |
println!("{:?}", (hello1, hello2)); | |
} | |
pub fn run() { | |
// Wrong One | |
let hello1 = "Hello"; | |
let mut hello2 = String::from("Hello"); | |
println!("{:?}", (hello1, hello2)); | |
hello2.push('\u{1f600}'); | |
println!("{}", hello1.len()); | |
println!("{}", hello2.len()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment