This commit is contained in:
octavio 2024-04-26 12:59:44 +02:00 committed by GitHub
commit 99443e1416
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -6,9 +6,9 @@ fn main() {
let x = 5; // x comes into scope
makes_copy(x); // x would move into the function,
// but i32 is Copy, so it's okay to still
// use x afterward
makes_copy(x); // since i32 implements the Copy trait,
// x does NOT move into the function,
println!("{}", x); // so it's okay to use x afterward
} // Here, x goes out of scope, then s. But because s's value was moved, nothing
// special happens.