Wrap inner tail expressions in MissingOkOrSomeInTailExpr

This commit is contained in:
Lukas Wirth 2021-07-31 20:00:09 +02:00
parent eb513c22f7
commit 1edbaa29f9
8 changed files with 69 additions and 11 deletions

View file

@ -164,6 +164,7 @@ impl ast::IfExpr {
pub fn then_branch(&self) -> Option<ast::BlockExpr> {
self.blocks().next()
}
pub fn else_branch(&self) -> Option<ElseBranch> {
let res = match self.blocks().nth(1) {
Some(block) => ElseBranch::Block(block),