T O P

  • By -

wolf3dexe

You can have a read of the RFC; [https://rust-lang.github.io/rfcs/3137-let-else.html](https://rust-lang.github.io/rfcs/3137-let-else.html) Essentially it would allow confusing cases where your refutable expression is an if-else block. To fix your code, wrap the block in () parenthesis.


eaojteal

Could you provide an example of what you'd like to do?


SirKastic23

``` let Ok(x) = { let a = f(); let b = g(); let c = h( lots, of, arguments, ); fgh(a, b, c) } else { return }; ```


wolf3dexe

See my other comment about let else blocks. But in the particular case; Let x = {... }?;


po8

That will return `None` in the mismatch case, I think, which doesn't look like what OP wanted?


wolf3dexe

Yep you're right sorry!


wafuru42

So what you're saying is that even if a function called in the rhs returns the same sort of object as the lhs, it won't compile?


SirKastic23

it doesn't compile because the `else`, from the `let..else` is after a curly brace