Last active
September 25, 2016 01:14
-
-
Save dumindu/0a442f5062ea5d1a27a9 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
let a = (1, 1.5, true, 'a', "Hello, world!"); | |
// a.0 = 1, a.1 = 1.5, a.2 = true, a.3 = 'a', a.4 = "Hello, world!" | |
let b: (i32, f64) = (1, 1.5); | |
let (c, d) = b; // c = 1, d = 1.5 | |
let (e, _, _, _, f) = a; //e = 1, f = "Hello, world!", _ indicates not interested of that item | |
let g = (0,); //single-element tuple | |
let h = (b, (2, 4), 5); //((1, 1.5), (2, 4), 5) | |
println!("{:?}", a); //(1, 1.5, true, 'a', "Hello, world!") | |
println!("{:#?}", a); | |
// ( | |
// 1, | |
// 1.5, | |
// true, | |
// 'a', | |
// "Hello, world!" | |
// ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment