From 455603f0a47b4e068817af707ba361cd977d8f45 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Tue, 10 May 2022 16:35:53 -0700 Subject: [PATCH] cargo fmt --- compiler/ast/src/expression/value.rs | 4 +--- compiler/passes/src/type_checker/check_expressions.rs | 11 +++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/compiler/ast/src/expression/value.rs b/compiler/ast/src/expression/value.rs index c97f538c40..1e9e148740 100644 --- a/compiler/ast/src/expression/value.rs +++ b/compiler/ast/src/expression/value.rs @@ -89,9 +89,7 @@ impl Node for ValueExpression { | Field(_, span) | Integer(_, _, span) | Scalar(_, span) - | String(_, span) => { - *span = new_span - } + | String(_, span) => *span = new_span, Char(character) => character.span = new_span, Group(group) => match &mut **group { GroupValue::Single(_, span) => *span = new_span, diff --git a/compiler/passes/src/type_checker/check_expressions.rs b/compiler/passes/src/type_checker/check_expressions.rs index 07d056eba6..08ed9f69d8 100644 --- a/compiler/passes/src/type_checker/check_expressions.rs +++ b/compiler/passes/src/type_checker/check_expressions.rs @@ -155,11 +155,11 @@ impl<'a> TypeChecker<'a> { return_incorrect_type(t1, t2, expected) } BinaryOperation::Add => { - self.assert_field_group_scalar_int_type(expected.clone(), binary.span()); - let t1 = self.compare_expr_type(&binary.left, expected.clone(), binary.left.span()); - let t2 = self.compare_expr_type(&binary.right, expected.clone(), binary.right.span()); + self.assert_field_group_scalar_int_type(expected.clone(), binary.span()); + let t1 = self.compare_expr_type(&binary.left, expected.clone(), binary.left.span()); + let t2 = self.compare_expr_type(&binary.right, expected.clone(), binary.right.span()); - return_incorrect_type(t1, t2, expected) + return_incorrect_type(t1, t2, expected) } BinaryOperation::Sub => { self.assert_field_group_int_type(expected.clone(), binary.span()); @@ -176,8 +176,7 @@ impl<'a> TypeChecker<'a> { // Allow `group` * `scalar` multiplication. match (t1.as_ref(), t2.as_ref()) { - (Some(Type::Group), Some(Type::Scalar)) - | (Some(Type::Scalar), Some(Type::Group)) => { + (Some(Type::Group), Some(Type::Scalar)) | (Some(Type::Scalar), Some(Type::Group)) => { Some(Type::Group) } _ => return_incorrect_type(t1, t2, expected),