RBE primitives tuples activity 2
This commit is contained in:
parent
cabb0a9eab
commit
20531d1154
@ -14,6 +14,10 @@ impl fmt::Display for Matrix {
|
||||
}
|
||||
}
|
||||
|
||||
fn transpose(m: Matrix) -> Matrix {
|
||||
Matrix(m.0, m.2, m.1, m.3)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let long_tuple = (
|
||||
1u8, 2u16, 3u32, 4u64, -1i8, -2i16, -3i32, -4i64, 0.1f32, 0.2f64, 'a', true,
|
||||
@ -42,4 +46,7 @@ fn main() {
|
||||
let matrix = Matrix(1.1, 1.2, 2.1, 2.2);
|
||||
println!("{:?}", matrix);
|
||||
println!("{}", matrix);
|
||||
|
||||
println!("Matrix:\n{}", matrix);
|
||||
println!("Transpose:\n{}", transpose(matrix));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user