Why isn’t it possible to assign values to two variables at once even though you can define them at the same time?
For example, this works:
let (mut prev, mut curr) = (3i32, 5i32);
println!("{}, {}", prev, curr);
But this does not:
let (mut prev, mut curr) = (3i32, 5i32);
(prev, curr) = (curr, prev + curr);
println!("{}, {}", prev, curr);
Shouldn’t there be a nice way to give both of these variables new values at the same time since they depend on each other? In Python the swap works as expected, and it makes a lot of code easier to read/write.