Use new rust 1.26 less verbose syntax

This commit is contained in:
greg 2018-05-11 23:26:02 -07:00
parent 6d8d2aecbd
commit 1011ff08f3
1 changed files with 7 additions and 7 deletions

View File

@ -72,13 +72,13 @@ impl Expression {
use parsing::ExpressionType::*; use parsing::ExpressionType::*;
let ref input = self.0; let ref input = self.0;
match input { match input {
&IntLiteral(ref n) => Expr::Lit(Lit::Nat(*n)), //TODO I should rename IntLiteral if I want the Nat/Int distinction, which I do IntLiteral(n) => Expr::Lit(Lit::Nat(*n)), //TODO I should rename IntLiteral if I want the Nat/Int distinction, which I do
&FloatLiteral(ref f) => Expr::Lit(Lit::Float(*f)), FloatLiteral(f) => Expr::Lit(Lit::Float(*f)),
&StringLiteral(ref s) => Expr::Lit(Lit::StringLit(s.clone())), StringLiteral(s) => Expr::Lit(Lit::StringLit(s.clone())),
&BoolLiteral(ref b) => Expr::Lit(Lit::Bool(*b)), BoolLiteral(b) => Expr::Lit(Lit::Bool(*b)),
&BinExp(ref binop, ref lhs, ref rhs) => binop.reduce(lhs, rhs), BinExp(binop, lhs, rhs) => binop.reduce(lhs, rhs),
&PrefixExp(ref op, ref arg) => op.reduce(arg), PrefixExp(op, arg) => op.reduce(arg),
&Value(ref name) => Expr::Val(name.clone()), Value(name) => Expr::Val(name.clone()),
/* /*
&Call { ref f, ref arguments } => Expr::Call { &Call { ref f, ref arguments } => Expr::Call {
f: Box<Expression>, f: Box<Expression>,