Skip to content

Commit 64d6853

Browse files
committed
clippy: fix the semicolon_if_nothing_returned lint
Just style.
1 parent 372d5d6 commit 64d6853

File tree

8 files changed

+44
-44
lines changed

8 files changed

+44
-44
lines changed

src/blind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,12 @@ impl Transaction {
10091009
let gen = Generator::new_unblinded(secp, asset.into_tag());
10101010
domain.push(gen);
10111011
let comm = PedersenCommitment::new_unblinded(secp, *v, gen);
1012-
in_commits.push(comm)
1012+
in_commits.push(comm);
10131013
}
10141014
Value::Confidential(comm) => {
10151015
let gen = Generator::new_unblinded(secp, asset.into_tag());
10161016
domain.push(gen);
1017-
in_commits.push(*comm)
1017+
in_commits.push(*comm);
10181018
}
10191019
}
10201020
}

src/pset/map/global.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl Map for Global {
268268
rv.push(raw::Pair {
269269
key: key.to_key(),
270270
value: vec![], // This is a bug in elements core c++, parses this value as vec![0]
271-
})
271+
});
272272
}
273273

274274
impl_pset_get_pair! {
@@ -437,7 +437,7 @@ impl Decodable for Global {
437437
decoder.read_exact(&mut fingerprint[..])?;
438438
let mut path = Vec::<ChildNumber>::with_capacity(child_count);
439439
while let Ok(index) = u32::consensus_decode(&mut decoder) {
440-
path.push(ChildNumber::from(index))
440+
path.push(ChildNumber::from(index));
441441
}
442442
let derivation = DerivationPath::from(path);
443443
// Keys, according to BIP-174, must be unique

src/pset/map/input.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl Input {
534534
confidential::Value::Null => {}
535535
confidential::Value::Explicit(x) => ret.issuance_inflation_keys = Some(x),
536536
confidential::Value::Confidential(comm) => {
537-
ret.issuance_inflation_keys_comm = Some(comm)
537+
ret.issuance_inflation_keys_comm = Some(comm);
538538
}
539539
}
540540

@@ -739,71 +739,71 @@ impl Map for Input {
739739
if prop_key.is_pset_key() {
740740
match prop_key.subtype {
741741
PSBT_ELEMENTS_IN_ISSUANCE_VALUE => {
742-
impl_pset_prop_insert_pair!(self.issuance_value_amount <= <raw_key: _> | <raw_value : u64>)
742+
impl_pset_prop_insert_pair!(self.issuance_value_amount <= <raw_key: _> | <raw_value : u64>);
743743
}
744744
PSBT_ELEMENTS_IN_ISSUANCE_VALUE_COMMITMENT => {
745-
impl_pset_prop_insert_pair!(self.issuance_value_comm <= <raw_key: _> | <raw_value : secp256k1_zkp::PedersenCommitment>)
745+
impl_pset_prop_insert_pair!(self.issuance_value_comm <= <raw_key: _> | <raw_value : secp256k1_zkp::PedersenCommitment>);
746746
}
747747
PSBT_ELEMENTS_IN_ISSUANCE_VALUE_RANGEPROOF => {
748-
impl_pset_prop_insert_pair!(self.issuance_value_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
748+
impl_pset_prop_insert_pair!(self.issuance_value_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
749749
}
750750
PSBT_ELEMENTS_IN_ISSUANCE_KEYS_RANGEPROOF => {
751-
impl_pset_prop_insert_pair!(self.issuance_keys_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
751+
impl_pset_prop_insert_pair!(self.issuance_keys_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
752752
}
753753
PSBT_ELEMENTS_IN_PEG_IN_TX => {
754-
impl_pset_prop_insert_pair!(self.pegin_tx <= <raw_key: _> | <raw_value : bitcoin::Transaction>)
754+
impl_pset_prop_insert_pair!(self.pegin_tx <= <raw_key: _> | <raw_value : bitcoin::Transaction>);
755755
}
756756
// No support for TxOutProof struct yet
757757
PSBT_ELEMENTS_IN_PEG_IN_TXOUT_PROOF => {
758-
impl_pset_prop_insert_pair!(self.pegin_txout_proof <= <raw_key: _> | <raw_value : Vec<u8>>)
758+
impl_pset_prop_insert_pair!(self.pegin_txout_proof <= <raw_key: _> | <raw_value : Vec<u8>>);
759759
}
760760
PSBT_ELEMENTS_IN_PEG_IN_GENESIS => {
761-
impl_pset_prop_insert_pair!(self.pegin_genesis_hash <= <raw_key: _> | <raw_value : BlockHash>)
761+
impl_pset_prop_insert_pair!(self.pegin_genesis_hash <= <raw_key: _> | <raw_value : BlockHash>);
762762
}
763763
PSBT_ELEMENTS_IN_PEG_IN_CLAIM_SCRIPT => {
764-
impl_pset_prop_insert_pair!(self.pegin_claim_script <= <raw_key: _> | <raw_value : Script>)
764+
impl_pset_prop_insert_pair!(self.pegin_claim_script <= <raw_key: _> | <raw_value : Script>);
765765
}
766766
PSBT_ELEMENTS_IN_PEG_IN_VALUE => {
767-
impl_pset_prop_insert_pair!(self.pegin_value <= <raw_key: _> | <raw_value : u64>)
767+
impl_pset_prop_insert_pair!(self.pegin_value <= <raw_key: _> | <raw_value : u64>);
768768
}
769769
PSBT_ELEMENTS_IN_PEG_IN_WITNESS => {
770-
impl_pset_prop_insert_pair!(self.pegin_witness <= <raw_key: _> | <raw_value : Vec<Vec<u8>>>)
770+
impl_pset_prop_insert_pair!(self.pegin_witness <= <raw_key: _> | <raw_value : Vec<Vec<u8>>>);
771771
}
772772
PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS => {
773-
impl_pset_prop_insert_pair!(self.issuance_inflation_keys <= <raw_key: _> | <raw_value : u64>)
773+
impl_pset_prop_insert_pair!(self.issuance_inflation_keys <= <raw_key: _> | <raw_value : u64>);
774774
}
775775
PSBT_ELEMENTS_IN_ISSUANCE_INFLATION_KEYS_COMMITMENT => {
776-
impl_pset_prop_insert_pair!(self.issuance_inflation_keys_comm <= <raw_key: _> | <raw_value : secp256k1_zkp::PedersenCommitment>)
776+
impl_pset_prop_insert_pair!(self.issuance_inflation_keys_comm <= <raw_key: _> | <raw_value : secp256k1_zkp::PedersenCommitment>);
777777
}
778778
PSBT_ELEMENTS_IN_ISSUANCE_BLINDING_NONCE => {
779-
impl_pset_prop_insert_pair!(self.issuance_blinding_nonce <= <raw_key: _> | <raw_value : Tweak>)
779+
impl_pset_prop_insert_pair!(self.issuance_blinding_nonce <= <raw_key: _> | <raw_value : Tweak>);
780780
}
781781
PSBT_ELEMENTS_IN_ISSUANCE_ASSET_ENTROPY => {
782-
impl_pset_prop_insert_pair!(self.issuance_asset_entropy <= <raw_key: _> | <raw_value : [u8;32]>)
782+
impl_pset_prop_insert_pair!(self.issuance_asset_entropy <= <raw_key: _> | <raw_value : [u8;32]>);
783783
}
784784
PSBT_ELEMENTS_IN_UTXO_RANGEPROOF => {
785-
impl_pset_prop_insert_pair!(self.in_utxo_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
785+
impl_pset_prop_insert_pair!(self.in_utxo_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
786786
}
787787
PSBT_ELEMENTS_IN_ISSUANCE_BLIND_VALUE_PROOF => {
788-
impl_pset_prop_insert_pair!(self.in_issuance_blind_value_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
788+
impl_pset_prop_insert_pair!(self.in_issuance_blind_value_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
789789
}
790790
PSBT_ELEMENTS_IN_ISSUANCE_BLIND_INFLATION_KEYS_PROOF => {
791-
impl_pset_prop_insert_pair!(self.in_issuance_blind_inflation_keys_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
791+
impl_pset_prop_insert_pair!(self.in_issuance_blind_inflation_keys_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
792792
}
793793
PSBT_ELEMENTS_IN_EXPLICIT_VALUE => {
794-
impl_pset_prop_insert_pair!(self.amount <= <raw_key: _> | <raw_value : u64>)
794+
impl_pset_prop_insert_pair!(self.amount <= <raw_key: _> | <raw_value : u64>);
795795
}
796796
PSBT_ELEMENTS_IN_VALUE_PROOF => {
797-
impl_pset_prop_insert_pair!(self.blind_value_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
797+
impl_pset_prop_insert_pair!(self.blind_value_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
798798
}
799799
PSBT_ELEMENTS_IN_EXPLICIT_ASSET => {
800-
impl_pset_prop_insert_pair!(self.asset <= <raw_key: _> | <raw_value : AssetId>)
800+
impl_pset_prop_insert_pair!(self.asset <= <raw_key: _> | <raw_value : AssetId>);
801801
}
802802
PSBT_ELEMENTS_IN_ASSET_PROOF => {
803-
impl_pset_prop_insert_pair!(self.blind_asset_proof <= <raw_key: _> | <raw_value : Box<SurjectionProof>>)
803+
impl_pset_prop_insert_pair!(self.blind_asset_proof <= <raw_key: _> | <raw_value : Box<SurjectionProof>>);
804804
}
805805
PSBT_ELEMENTS_IN_BLINDED_ISSUANCE => {
806-
impl_pset_prop_insert_pair!(self.blinded_issuance <= <raw_key: _> | <raw_value : u8>)
806+
impl_pset_prop_insert_pair!(self.blinded_issuance <= <raw_key: _> | <raw_value : u8>);
807807
}
808808
_ => match self.proprietary.entry(prop_key) {
809809
Entry::Vacant(empty_key) => {

src/pset/map/output.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -345,34 +345,34 @@ impl Map for Output {
345345
if prop_key.is_pset_key() {
346346
match prop_key.subtype {
347347
PSBT_ELEMENTS_OUT_VALUE_COMMITMENT => {
348-
impl_pset_prop_insert_pair!(self.amount_comm <= <raw_key: _> | <raw_value : secp256k1_zkp::PedersenCommitment>)
348+
impl_pset_prop_insert_pair!(self.amount_comm <= <raw_key: _> | <raw_value : secp256k1_zkp::PedersenCommitment>);
349349
}
350350
PSBT_ELEMENTS_OUT_ASSET => {
351-
impl_pset_prop_insert_pair!(self.asset <= <raw_key: _> | <raw_value : AssetId>)
351+
impl_pset_prop_insert_pair!(self.asset <= <raw_key: _> | <raw_value : AssetId>);
352352
}
353353
PSBT_ELEMENTS_OUT_ASSET_COMMITMENT => {
354-
impl_pset_prop_insert_pair!(self.asset_comm <= <raw_key: _> | <raw_value : Generator>)
354+
impl_pset_prop_insert_pair!(self.asset_comm <= <raw_key: _> | <raw_value : Generator>);
355355
}
356356
PSBT_ELEMENTS_OUT_VALUE_RANGEPROOF => {
357-
impl_pset_prop_insert_pair!(self.value_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
357+
impl_pset_prop_insert_pair!(self.value_rangeproof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
358358
}
359359
PSBT_ELEMENTS_OUT_ASSET_SURJECTION_PROOF => {
360-
impl_pset_prop_insert_pair!(self.asset_surjection_proof <= <raw_key: _> | <raw_value : Box<SurjectionProof>>)
360+
impl_pset_prop_insert_pair!(self.asset_surjection_proof <= <raw_key: _> | <raw_value : Box<SurjectionProof>>);
361361
}
362362
PSBT_ELEMENTS_OUT_BLINDING_PUBKEY => {
363-
impl_pset_prop_insert_pair!(self.blinding_key <= <raw_key: _> | <raw_value : PublicKey>)
363+
impl_pset_prop_insert_pair!(self.blinding_key <= <raw_key: _> | <raw_value : PublicKey>);
364364
}
365365
PSBT_ELEMENTS_OUT_ECDH_PUBKEY => {
366-
impl_pset_prop_insert_pair!(self.ecdh_pubkey <= <raw_key: _> | <raw_value : PublicKey>)
366+
impl_pset_prop_insert_pair!(self.ecdh_pubkey <= <raw_key: _> | <raw_value : PublicKey>);
367367
}
368368
PSBT_ELEMENTS_OUT_BLINDER_INDEX => {
369-
impl_pset_prop_insert_pair!(self.blinder_index <= <raw_key: _> | <raw_value : u32>)
369+
impl_pset_prop_insert_pair!(self.blinder_index <= <raw_key: _> | <raw_value : u32>);
370370
}
371371
PSBT_ELEMENTS_OUT_BLIND_VALUE_PROOF => {
372-
impl_pset_prop_insert_pair!(self.blind_value_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>)
372+
impl_pset_prop_insert_pair!(self.blind_value_proof <= <raw_key: _> | <raw_value : Box<RangeProof>>);
373373
}
374374
PSBT_ELEMENTS_OUT_BLIND_ASSET_PROOF => {
375-
impl_pset_prop_insert_pair!(self.blind_asset_proof <= <raw_key: _> | <raw_value : Box<SurjectionProof>>)
375+
impl_pset_prop_insert_pair!(self.blind_asset_proof <= <raw_key: _> | <raw_value : Box<SurjectionProof>>);
376376
}
377377
_ => match self.proprietary.entry(prop_key) {
378378
Entry::Vacant(empty_key) => {

src/pset/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl PartiallySignedTransaction {
441441
value: 0, // This value really does not matter in surjection proofs
442442
value_bf: ValueBlindingFactor::zero(),
443443
};
444-
ret.push(SurjectionInput::from_txout_secrets(secrets))
444+
ret.push(SurjectionInput::from_txout_secrets(secrets));
445445
}
446446
if inp.issuance_inflation_keys.is_some()
447447
|| inp.issuance_inflation_keys_comm.is_some()
@@ -452,7 +452,7 @@ impl PartiallySignedTransaction {
452452
value: 0, // This value really does not matter in surjection proofs
453453
value_bf: ValueBlindingFactor::zero(),
454454
};
455-
ret.push(SurjectionInput::from_txout_secrets(secrets))
455+
ret.push(SurjectionInput::from_txout_secrets(secrets));
456456
}
457457
}
458458
}
@@ -688,7 +688,7 @@ impl PartiallySignedTransaction {
688688
.map_err(|e| PsetBlindError::BlindingProofsCreationError(last_out_index, e))?,
689689
));
690690

691-
self.global.scalars.clear()
691+
self.global.scalars.clear();
692692
}
693693
Ok(())
694694
}

src/pset/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Encodable for Key {
152152
len += self.type_value.consensus_encode(&mut s)?;
153153

154154
for key in &self.key {
155-
len += key.consensus_encode(&mut s)?
155+
len += key.consensus_encode(&mut s)?;
156156
}
157157

158158
Ok(len)

src/pset/serialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl Serialize for KeySource {
167167
rv.append(&mut self.0.to_bytes().to_vec());
168168

169169
for cnum in &self.1 {
170-
rv.append(&mut serialize(&u32::from(*cnum)))
170+
rv.append(&mut serialize(&u32::from(*cnum)));
171171
}
172172

173173
rv

src/taproot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ mod tests{
932932
for (_weights, script) in script_weights {
933933
let ver_script = (script, LeafVersion::default());
934934
let ctrl_block = tree_info.control_block(&ver_script).unwrap();
935-
assert!(ctrl_block.verify_taproot_commitment(&secp, &output_key, &ver_script.0))
935+
assert!(ctrl_block.verify_taproot_commitment(&secp, &output_key, &ver_script.0));
936936
}
937937
}
938938

@@ -971,7 +971,7 @@ mod tests{
971971
for script in scripts {
972972
let ver_script = (script, LeafVersion::default());
973973
let ctrl_block = tree_info.control_block(&ver_script).unwrap();
974-
assert!(ctrl_block.verify_taproot_commitment(&secp, &output_key, &ver_script.0))
974+
assert!(ctrl_block.verify_taproot_commitment(&secp, &output_key, &ver_script.0));
975975
}
976976
}
977977
}

0 commit comments

Comments
 (0)