This is one of the things I like about Rust. You can have both.
let foo = {
if bar {
1
} else if baz {
2
} else {
3
}
};
Unfortunately not all languages are Rust.This is one of the things I like about Rust. You can have both.
let foo = {
if bar {
1
} else if baz {
2
} else {
3
}
};
Unfortunately not all languages are Rust.
That isn't more concise than
But it's more readable, and that's what matters.