Rust would allow you to
let ret = if some_condition {
<a lot of expensive calculations>
result_of_operations
} else {
<a lot of other different expensive calculations>
result_of_other_operations
};
Now you don't have to declare it inside the blocks.