From 24b532df064fc71c073d745ce5f16f66f43634b3 Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 12 May 2018 20:51:30 -0700 Subject: [PATCH] This doesn't need to be a closure --- schala-lang/src/parsing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schala-lang/src/parsing.rs b/schala-lang/src/parsing.rs index ee2dd7c..8eee7a6 100644 --- a/schala-lang/src/parsing.rs +++ b/schala-lang/src/parsing.rs @@ -694,12 +694,12 @@ impl Parser { parse_method!(if_expr(&mut self) -> ParseResult { expect!(self, Keyword(Kw::If), "'if'"); - let condition = (|| { + let condition = { self.restrictions.no_struct_literal = true; let x = self.expression(); self.restrictions.no_struct_literal = false; - x - })()?; + x? + }; let then_clause = self.block()?; let else_clause = self.else_clause()?; Ok(Expression(ExpressionType::IfExpression(bx!(condition), then_clause, else_clause), None))