Skip to content

Commit 88c9a12

Browse files
authored
Remove temporary binding and return match result directly in almost_equals (#413)
1 parent 11d2d01 commit 88c9a12

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tests.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ macro_rules! JArray {
2424
}
2525

2626
fn almost_equals(a: &Value, b: &Value) -> bool {
27-
let var_name = match (a, b) {
27+
match (a, b) {
2828
(Value::Number(a), Value::Number(b)) => {
2929
let a = a.as_f64().unwrap();
3030
let b = b.as_f64().unwrap();
@@ -39,8 +39,7 @@ fn almost_equals(a: &Value, b: &Value) -> bool {
3939
(&Value::Object(_), &Value::Object(_)) => panic!("Not implemented"),
4040
(&Value::Null, &Value::Null) => true,
4141
_ => false,
42-
};
43-
var_name
42+
}
4443
}
4544

4645
fn normalize(json: &mut Value) {

0 commit comments

Comments
 (0)