Skip to content

Commit 4881b80

Browse files
committed
Address Clippy warnings.
1 parent b0f2220 commit 4881b80

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

jaq-fmts/tests/formats.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn jc(json: &str, cbor_hex: &str) {
1919

2020
let cbor_bin = decode_hex(cbor_hex).unwrap();
2121
//dbg!(&cbor_bin);
22-
let cbor_val = unwrap_collect(read::cbor::parse_many(&*cbor_bin));
22+
let cbor_val = unwrap_collect(read::cbor::parse_many(&cbor_bin));
2323
assert_eq!(json_val, cbor_val);
2424

2525
let mut cbor_bin2 = Vec::new();
@@ -28,13 +28,13 @@ fn jc(json: &str, cbor_hex: &str) {
2828
}
2929
//dbg!(&cbor_bin2);
3030

31-
let cbor_val2 = unwrap_collect(read::cbor::parse_many(&*cbor_bin2));
31+
let cbor_val2 = unwrap_collect(read::cbor::parse_many(&cbor_bin2));
3232
assert_eq!(cbor_val, cbor_val2);
3333
}
3434

3535
fn cbor_fail(cbor_hex: &str) {
3636
let cbor_bin = decode_hex(cbor_hex).unwrap();
37-
let iter = read::cbor::parse_many(&*cbor_bin);
37+
let iter = read::cbor::parse_many(&cbor_bin);
3838
assert!(iter.collect::<Result<Vec<_>, _>>().is_err())
3939
}
4040

jaq-json/src/num.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,16 @@ impl Hash for Num {
308308

309309
#[test]
310310
fn hash_nums() {
311+
use core::f64::consts::PI;
311312
use core::hash::BuildHasher;
312313
let h = |n| foldhash::fast::FixedState::with_seed(42).hash_one(n);
313314

314315
assert_eq!(h(Num::Int(4096)), h(Num::big_int(4096.into())));
315316
assert_eq!(h(Num::Float(0.0)), h(Num::Int(0)));
316317
assert_eq!(h(Num::Float(3.0)), h(Num::big_int(3.into())));
317-
assert_eq!(h(Num::Float(f64::NAN)), h(Num::Float(0.0 / 0.0)));
318318

319319
assert_ne!(h(Num::Float(0.2)), h(Num::Float(0.4)));
320-
assert_ne!(h(Num::Float(3.1415)), h(Num::big_int(3.into())));
320+
assert_ne!(h(Num::Float(PI)), h(Num::big_int(3.into())));
321321
assert_ne!(h(Num::Float(0.2)), h(Num::Int(1)));
322322
assert_ne!(h(Num::Int(1)), h(Num::Int(2)));
323323
}

jaq-std/tests/funs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ yields!(
141141
);
142142

143143
#[test]
144+
#[allow(clippy::zero_prefixed_literal)]
144145
fn regex() {
145146
let date = r#"(\\d{4})-(\\d{2})-(\\d{2})"#;
146147
let s = "2012-03-14, 2013-01-01 and 2014-07-05";

jaq/tests/golden.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ test!(
151151
fmt_str,
152152
&[],
153153
r#""\u0000\u200b\r\t\n asdf""#,
154-
r#""\u0000​\r\t\n asdf""#
154+
"\"\\u0000\u{200b}\\r\\t\\n asdf\""
155155
);
156156

157157
test!(

0 commit comments

Comments
 (0)