Last active
May 2, 2024 14:24
-
-
Save georgematos/69f0aa2a2c1eebb8238bce9a934397fb to your computer and use it in GitHub Desktop.
Rust - destructuring (tuple exemple) sample
This file contains 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
// destructure | |
fn main() { | |
let tuple: (i32, f64, String) = (500, 38.8, "Rust".to_string()); | |
let (a, b, c) = tuple; | |
println!("content: {a}, {b}, {c}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment