Advertisement
cwchen

[Rust] Copying a value, no moved value

Aug 27th, 2017
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.13 KB | None | 0 0
  1. fn main() {
  2.     let x = 3;
  3.  
  4.     // Copy x into x1
  5.     let x1 = x;
  6.  
  7.     // No error when accessing x
  8.     println!("{}", x);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement