From 1ea035c1c2950a4a86dfa09756c5f24d02c0c256 Mon Sep 17 00:00:00 2001 From: vic1707 <28602203+vic1707@users.noreply.github.com> Date: Sun, 15 Oct 2023 23:32:24 +0200 Subject: [PATCH] fmt --- src/element/comp_time.rs | 19 ++++++++++--------- src/parser.rs | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/element/comp_time.rs b/src/element/comp_time.rs index 3df0d74..7e97786 100644 --- a/src/element/comp_time.rs +++ b/src/element/comp_time.rs @@ -165,15 +165,16 @@ impl<'a> CompTime<'a> for UnOp<'a> { Operator::Plus => operand, Operator::Minus => match operand { Element::Number(num) => Element::Number(-num), - Element::UnOp(unop) => { - match unop.op { - Operator::Plus => Element::UnOp(Box::new(UnOp::new(Operator::Minus, unop.operand))), - Operator::Minus => unop.operand, - Operator::Times - | Operator::Divide - | Operator::Power - | Operator::Modulo => unreachable!(), - } + Element::UnOp(unop) => match unop.op { + Operator::Plus => Element::UnOp(Box::new(UnOp::new( + Operator::Minus, + unop.operand, + ))), + Operator::Minus => unop.operand, + Operator::Times + | Operator::Divide + | Operator::Power + | Operator::Modulo => unreachable!(), }, Element::BinOp(_) | Element::Function(_) diff --git a/src/parser.rs b/src/parser.rs index d2f659a..4f98c7f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -6,7 +6,7 @@ use std::collections::HashSet; /* Crate imports */ use crate::{ context::Context, - element::{BinOp, Element, FunctionCall, UnOp, CompTime}, + element::{BinOp, CompTime, Element, FunctionCall, UnOp}, macros::{trust_me, yeet}, token::{Identifier, Operator}, utils::precedence,