Created
September 11, 2016 09:09
-
-
Save loloof64/609a98a5854d79a205ed242e1cd4a8c8 to your computer and use it in GitHub Desktop.
How creating and swapping variables is very easy in Rust
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 (a,b) = (10, 20); | |
| println!("Before swapping : a = {} and b = {}.", a, b); | |
| let (b,a) = (a,b); | |
| println!("After swapping : a = {} and b = {}.", a, b); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment