Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Created Jul 12, 2022
Embed
What would you like to do?
What is the mean of "value borrowed here after move"
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