let us look at Rust tuples examples.
fn main() {
let tuple:(i32,f64,u8) = (-225,5.9,32);
println!("{:?}",tuple);
println!("integer value is :{:?}",tuple.0);
println!("float value is :{:?}",tuple.1);
println!("unsigned integer value is :{:?}",tuple.2);
}
The code above is compiled using the below command.
rustc tuples.rs
The output will be as below:
apples-MacBook-Air:tuple bhagvan.kommadi$ rustc tuples.rs
apples-MacBook-Air:tuple bhagvan.kommadi$ ./tuples
(-225, 5.9, 32)
integer value is :-225
float value is :5.9
unsigned integer value is :32