Created
August 31, 2018 07:03
-
-
Save ingride/8a79cb93d869eaa4b57fe2939d9601fc to your computer and use it in GitHub Desktop.
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
fn main() { | |
let s = String::from("hello"); // s comes into scope | |
takes_ownership(s); | |
println!("same s {}", s); // nope! | |
} | |
fn takes_ownership(some_string: String) { // some_string comes into scope | |
println!("{}", some_string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment