Skip to content

Commit 3a77803

Browse files
authored
Don't move the Values being compared in assert_json_matches (#28)
1 parent e074cb5 commit 3a77803

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ macro_rules! assert_json_eq {
252252
#[macro_export]
253253
macro_rules! assert_json_matches {
254254
($lhs:expr, $rhs:expr, $config:expr $(,)?) => {{
255-
let lhs = $lhs;
256-
let rhs = $rhs;
257-
if let Err(error) = $crate::assert_json_matches_no_panic(&lhs, &rhs, $config) {
255+
if let Err(error) = $crate::assert_json_matches_no_panic(&$lhs, &$rhs, $config) {
258256
panic!("\n\n{}\n\n", error);
259257
}
260258
}};

tests/integration_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn different_numeric_types_assume_float() {
6060
let actual = json!({ "a": { "b": true }, "c": [true, null, 1] });
6161
let expected = json!({ "a": { "b": true }, "c": [true, null, 1.0] });
6262
let config = Config::new(CompareMode::Inclusive).numeric_mode(NumericMode::AssumeFloat);
63-
assert_json_matches!(&actual, &expected, config.clone());
63+
assert_json_matches!(actual, expected, config.clone());
6464

6565
assert_json_matches!(actual, expected, config.compare_mode(CompareMode::Strict))
6666
}

0 commit comments

Comments
 (0)