Advertisement
Guest User

Untitled

a guest
Oct 9th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. fn main() {
  2. let string = String::from("string");
  3. move_ownership(string); // 所有権が関数に移動する
  4. }
  5.  
  6. fn move_ownership(string: String) {
  7. println!("{}", string);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement