From a516651d617e8e1d099899fc4d4c20cc0222505c Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 13 Jul 2023 16:35:47 +0000 Subject: [PATCH] clippy: fix some new lints --- jets-bench/benches/elements/main.rs | 6 +++--- src/bit_encoding/decode.rs | 2 +- src/bit_machine/mod.rs | 6 +++--- src/node/commit.rs | 2 +- src/node/redeem.rs | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/jets-bench/benches/elements/main.rs b/jets-bench/benches/elements/main.rs index 3cb8dfd6..a79dca1d 100644 --- a/jets-bench/benches/elements/main.rs +++ b/jets-bench/benches/elements/main.rs @@ -471,7 +471,7 @@ fn bench(c: &mut Criterion) { let (src_ty, tgt_ty) = jet_arrow(jet); let env = env_sampler.env(); - let mut group = c.benchmark_group(&format!("{}", jet.to_string())); + let mut group = c.benchmark_group(&jet.to_string()); for i in 0..NUM_RANDOM_SAMPLES { let params = JetParams::with_rand_aligns(InputSampling::Random); let name = format!("{}", i); @@ -531,7 +531,7 @@ fn bench(c: &mut Criterion) { let (src_ty, tgt_ty) = jet_arrow(jet); let env = EnvSampling::Null.env(); - let mut group = c.benchmark_group(&format!("{}", jet.to_string())); + let mut group = c.benchmark_group(&jet.to_string()); for i in 0..NUM_RANDOM_SAMPLES { let params = JetParams::with_rand_aligns(InputSampling::Custom(inp_fn.clone())); let name = format!("{}", i); @@ -612,7 +612,7 @@ fn bench(c: &mut Criterion) { for (jet, index, env_type) in arr { let (src_ty, tgt_ty) = jet_arrow(jet); let env = env_type.env(); - let mut group = c.benchmark_group(&format!("{}", jet.to_string())); + let mut group = c.benchmark_group(&jet.to_string()); for i in 0..NUM_RANDOM_SAMPLES { // We always select the current input because this is where we diff --git a/src/bit_encoding/decode.rs b/src/bit_encoding/decode.rs index 014fd171..c9e18257 100644 --- a/src/bit_encoding/decode.rs +++ b/src/bit_encoding/decode.rs @@ -410,7 +410,7 @@ mod tests { #[test] fn root_unit_to_unit() { // main = jet_eq_32 :: 2^64 -> 2 # 7387d279 - let justjet = vec![0x6d, 0xb8, 0x80]; + let justjet = [0x6d, 0xb8, 0x80]; // Should be able to decode this as an expression... let mut iter = BitIter::from(&justjet[..]); decode_expression::<_, Core>(&mut iter).unwrap(); diff --git a/src/bit_machine/mod.rs b/src/bit_machine/mod.rs index b3f16cd2..007cb9a8 100644 --- a/src/bit_machine/mod.rs +++ b/src/bit_machine/mod.rs @@ -528,7 +528,7 @@ mod tests { prog.cmr().to_string(), cmr_str, "CMR mismatch (got {} expected {}) for program {}", - prog.cmr().to_string(), + prog.cmr(), cmr_str, prog_hex, ); @@ -536,7 +536,7 @@ mod tests { prog.imr().to_string(), imr_str, "IMR mismatch (got {} expected {}) for program {}", - prog.imr().to_string(), + prog.imr(), imr_str, prog_hex, ); @@ -544,7 +544,7 @@ mod tests { prog.amr().to_string(), amr_str, "AMR mismatch (got {} expected {}) for program {}", - prog.amr().to_string(), + prog.amr(), amr_str, prog_hex, ); diff --git a/src/node/commit.rs b/src/node/commit.rs index 7f63332c..3ecd121e 100644 --- a/src/node/commit.rs +++ b/src/node/commit.rs @@ -314,7 +314,7 @@ mod tests { prog.cmr().to_string(), cmr_str, "CMR mismatch (got {} expected {}) for program {}", - prog.cmr().to_string(), + prog.cmr(), cmr_str, prog_hex, ); diff --git a/src/node/redeem.rs b/src/node/redeem.rs index 29d66ddd..e55cd5dd 100644 --- a/src/node/redeem.rs +++ b/src/node/redeem.rs @@ -366,7 +366,7 @@ mod tests { prog.cmr().to_string(), cmr_str, "CMR mismatch (got {} expected {}) for program {}", - prog.cmr().to_string(), + prog.cmr(), cmr_str, prog_hex, ); @@ -375,7 +375,7 @@ mod tests { prog.amr().to_string(), amr_str, "AMR mismatch (got {} expected {}) for program {}", - prog.amr().to_string(), + prog.amr(), amr_str, prog_hex, ); @@ -383,7 +383,7 @@ mod tests { prog.imr().to_string(), imr_str, "IMR mismatch (got {} expected {}) for program {}", - prog.imr().to_string(), + prog.imr(), imr_str, prog_hex, ); @@ -426,7 +426,7 @@ mod tests { // // wits_are_equal = comp (pair wit1 wit2) jet_eq_32 :: 1 -> 2 // main = comp wits_are_equal jet_verify :: 1 -> 1 - let eqwits = vec![0xcd, 0xdc, 0x51, 0xb6, 0xe2, 0x08, 0xc0, 0x40]; + let eqwits = [0xcd, 0xdc, 0x51, 0xb6, 0xe2, 0x08, 0xc0, 0x40]; let mut iter = BitIter::from(&eqwits[..]); let eqwits_prog = CommitNode::::decode(&mut iter).unwrap(); @@ -474,7 +474,7 @@ mod tests { #[test] fn witness_consumed() { // "main = unit", but with a witness attached. Found by fuzzer. - let badwit = vec![0x27, 0x00]; + let badwit = [0x27, 0x00]; let mut iter = BitIter::from(&badwit[..]); if let Err(Error::InconsistentWitnessLength) = RedeemNode::::decode(&mut iter)