Skip to content

Commit

Permalink
clippy: fix some new lints
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Jul 13, 2023
1 parent 07ac274 commit a516651
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions jets-bench/benches/elements/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/bit_encoding/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/bit_machine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,23 +528,23 @@ mod tests {
prog.cmr().to_string(),
cmr_str,
"CMR mismatch (got {} expected {}) for program {}",
prog.cmr().to_string(),
prog.cmr(),
cmr_str,
prog_hex,
);
assert_eq!(
prog.imr().to_string(),
imr_str,
"IMR mismatch (got {} expected {}) for program {}",
prog.imr().to_string(),
prog.imr(),
imr_str,
prog_hex,
);
assert_eq!(
prog.amr().to_string(),
amr_str,
"AMR mismatch (got {} expected {}) for program {}",
prog.amr().to_string(),
prog.amr(),
amr_str,
prog_hex,
);
Expand Down
2 changes: 1 addition & 1 deletion src/node/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
10 changes: 5 additions & 5 deletions src/node/redeem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand All @@ -375,15 +375,15 @@ mod tests {
prog.amr().to_string(),
amr_str,
"AMR mismatch (got {} expected {}) for program {}",
prog.amr().to_string(),
prog.amr(),
amr_str,
prog_hex,
);
assert_eq!(
prog.imr().to_string(),
imr_str,
"IMR mismatch (got {} expected {}) for program {}",
prog.imr().to_string(),
prog.imr(),
imr_str,
prog_hex,
);
Expand Down Expand Up @@ -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::<Core>::decode(&mut iter).unwrap();

Expand Down Expand Up @@ -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::<crate::jet::Core>::decode(&mut iter)
Expand Down

0 comments on commit a516651

Please sign in to comment.