Skip to content

Commit 96fb955

Browse files
committed
Fix formatting
1 parent 988865d commit 96fb955

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

src/ast.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub enum Expression {
3434
IdentifierExpression(String),
3535
BinaryExpression(Box<Expression>, String, Box<Expression>),
3636
FunctionCall(String, Vec<Expression>),
37-
}
37+
}
3838

3939
#[derive(Debug, Clone, PartialEq, PartialOrd)]
4040
pub enum Statement {
@@ -190,15 +190,17 @@ impl PartialEq for Expression {
190190
}
191191
}
192192
true
193-
},
193+
}
194194
// Compare BinaryExpression
195-
(Expression::BinaryExpression(l_l, l_op, l_r), Expression::BinaryExpression(r_l, r_op, r_r)) => {
196-
l_l == r_l && l_op == r_op && l_r == r_r
197-
},
195+
(
196+
Expression::BinaryExpression(l_l, l_op, l_r),
197+
Expression::BinaryExpression(r_l, r_op, r_r),
198+
) => l_l == r_l && l_op == r_op && l_r == r_r,
198199
// Compare FunctionCall
199-
(Expression::FunctionCall(l_name, l_args), Expression::FunctionCall(r_name, r_args)) => {
200-
l_name == r_name && l_args == r_args
201-
},
200+
(
201+
Expression::FunctionCall(l_name, l_args),
202+
Expression::FunctionCall(r_name, r_args),
203+
) => l_name == r_name && l_args == r_args,
202204

203205
// Different types are not equal
204206
_ => false,
@@ -220,7 +222,9 @@ impl PartialOrd for Expression {
220222
// Compare NilLiteral
221223
(Expression::NilLiteral, Expression::NilLiteral) => Some(Ordering::Equal),
222224
// Compare IdentifierExpression
223-
(Expression::IdentifierExpression(l), Expression::IdentifierExpression(r)) => l.partial_cmp(r),
225+
(Expression::IdentifierExpression(l), Expression::IdentifierExpression(r)) => {
226+
l.partial_cmp(r)
227+
}
224228
// Compare TableLiteral
225229
(Expression::TableLiteral(l), Expression::TableLiteral(r)) => {
226230
if let Some(ord) = l.keys().partial_cmp(r.keys()) {
@@ -231,7 +235,7 @@ impl PartialOrd for Expression {
231235
} else {
232236
None
233237
}
234-
},
238+
}
235239
// Compare BinaryExpression
236240
(Expression::BinaryExpression(l, _, r), Expression::BinaryExpression(ll, _, rr)) => {
237241
if let Some(ord) = l.partial_cmp(ll) {
@@ -242,7 +246,7 @@ impl PartialOrd for Expression {
242246
} else {
243247
None
244248
}
245-
},
249+
}
246250
// Compare FunctionCall
247251
(Expression::FunctionCall(l, _), Expression::FunctionCall(r, _)) => l.partial_cmp(r),
248252

src/parser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ impl<'a> Parser<'a> {
452452
} // Skip comma
453453
_ => {
454454
let element = self.parse_expression(tokens)?;
455-
table_structure.insert(Expression::NumberLiteral(in_table_index as f64), element);
455+
table_structure
456+
.insert(Expression::NumberLiteral(in_table_index as f64), element);
456457
in_table_index += 1;
457458
}
458459
}

0 commit comments

Comments
 (0)