This commit is contained in:
nora 2023-05-28 19:02:20 +02:00
parent 2b39ddebb2
commit b7108770b9
7 changed files with 28 additions and 23 deletions

View file

@ -542,7 +542,7 @@ where
let cond = self.expr()?;
let _paren_span = expect!(self, Tok::Punct(P::ParenClose));
let then = self.compount_or_single_statement()?;
let otherwise = if let Some(_) = eat!(self, Tok::Kw(Kw::Else)) {
let otherwise = if eat!(self, Tok::Kw(Kw::Else)).is_some() {
Some(self.compount_or_single_statement()?)
} else {
None