From bbe6280bb0d4ffd6785b62ef187d5433efbb5129 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Fri, 9 Dec 2022 09:31:33 -0700 Subject: [PATCH 1/2] Fix clippy complaints. --- zcash_client_backend/src/welding_rig.rs | 1 + zcash_history/examples/write.rs | 2 +- zcash_history/src/node_data.rs | 2 +- .../src/transaction/components/transparent/builder.rs | 2 +- zcash_proofs/src/lib.rs | 5 ++--- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zcash_client_backend/src/welding_rig.rs b/zcash_client_backend/src/welding_rig.rs index 932c35b2d..aba28a541 100644 --- a/zcash_client_backend/src/welding_rig.rs +++ b/zcash_client_backend/src/welding_rig.rs @@ -191,6 +191,7 @@ pub(crate) fn add_block_to_runner( } #[tracing::instrument(skip_all, fields(height = block.height))] +#[allow(clippy::suspicious_else_formatting)] pub(crate) fn scan_block_with_runner< P: consensus::Parameters + Send + 'static, K: ScanningKey, diff --git a/zcash_history/examples/write.rs b/zcash_history/examples/write.rs index cd9d6511c..0d894eb74 100644 --- a/zcash_history/examples/write.rs +++ b/zcash_history/examples/write.rs @@ -32,7 +32,7 @@ fn main() { node.write(&mut buf).expect("Failed to write data"); } - let mut file = std::fs::File::create(&out_file_path).expect("Failed to create output file"); + let mut file = std::fs::File::create(out_file_path).expect("Failed to create output file"); file.write_all(&buf[..]) .expect("Failed to write data to file"); diff --git a/zcash_history/src/node_data.rs b/zcash_history/src/node_data.rs index b0f062fc1..315f3fabb 100644 --- a/zcash_history/src/node_data.rs +++ b/zcash_history/src/node_data.rs @@ -248,7 +248,7 @@ mod tests { quickcheck! { fn serialization_round_trip(node_data: NodeData) -> TestResult { - TestResult::from_bool(NodeData::from_bytes(0, &node_data.to_bytes()).unwrap() == node_data) + TestResult::from_bool(NodeData::from_bytes(0, node_data.to_bytes()).unwrap() == node_data) } } } diff --git a/zcash_primitives/src/transaction/components/transparent/builder.rs b/zcash_primitives/src/transaction/components/transparent/builder.rs index e32398072..a05e03ff9 100644 --- a/zcash_primitives/src/transaction/components/transparent/builder.rs +++ b/zcash_primitives/src/transaction/components/transparent/builder.rs @@ -294,7 +294,7 @@ impl Bundle { // Signature has to have "SIGHASH_ALL" appended to it let mut sig_bytes: Vec = sig.serialize_der()[..].to_vec(); - sig_bytes.extend([SIGHASH_ALL as u8]); + sig_bytes.extend([SIGHASH_ALL]); // P2PKH scriptSig Script::default() << &sig_bytes[..] << &info.pubkey[..] diff --git a/zcash_proofs/src/lib.rs b/zcash_proofs/src/lib.rs index 5ee22508e..346fa48ad 100644 --- a/zcash_proofs/src/lib.rs +++ b/zcash_proofs/src/lib.rs @@ -363,9 +363,8 @@ pub fn parse_parameters( // We only deserialize the verifying key for the Sprout parameters, which // appears at the beginning of the parameter file. The rest is loaded // during proving time. - let sprout_vk = sprout_fs.as_mut().map(|mut fs| { - VerifyingKey::::read(&mut fs) - .expect("couldn't deserialize Sprout Groth16 verifying key") + let sprout_vk = sprout_fs.as_mut().map(|fs| { + VerifyingKey::::read(fs).expect("couldn't deserialize Sprout Groth16 verifying key") }); // There is extra stuff (the transcript) at the end of the parameter file which is From 77d6ef2fd8532c306c757f237c531eb96fc51e62 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Fri, 9 Dec 2022 15:00:46 -0700 Subject: [PATCH 2/2] Update zcash_client_backend/src/welding_rig.rs Co-authored-by: str4d --- zcash_client_backend/src/welding_rig.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/zcash_client_backend/src/welding_rig.rs b/zcash_client_backend/src/welding_rig.rs index aba28a541..932c35b2d 100644 --- a/zcash_client_backend/src/welding_rig.rs +++ b/zcash_client_backend/src/welding_rig.rs @@ -191,7 +191,6 @@ pub(crate) fn add_block_to_runner( } #[tracing::instrument(skip_all, fields(height = block.height))] -#[allow(clippy::suspicious_else_formatting)] pub(crate) fn scan_block_with_runner< P: consensus::Parameters + Send + 'static, K: ScanningKey,