4 ms·
> Digressing, were there any discussions about using var like in Swift (instead of let mut)? What is the rationale for not making that more minimalistic? There
by azth 12y ago
> Digressing, were there any discussions about using var like in Swift (instead of let mut)? What is the rationale for not making that more minimalistic?
There were (I think it was somewhere on GitHub). One of the things `let mut` facilitates is:
fn main() {
let (i, mut j) = (10i, 10i);
j += 1;
println!("{}", (i, j));
}
I'm sure there are other applications for it too (such as in pattern matching). It just fits better into Rust.