diff --git a/pallas-applying/tests/babbage.rs b/pallas-applying/tests/babbage.rs index 3aa6dd82..763642fc 100644 --- a/pallas-applying/tests/babbage.rs +++ b/pallas-applying/tests/babbage.rs @@ -1,7 +1,6 @@ pub mod common; use common::*; -use hex; use pallas_addresses::{Address, Network, ShelleyAddress, ShelleyPaymentPart}; use pallas_applying::{ utils::{ @@ -598,7 +597,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -675,7 +674,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -725,7 +724,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -857,7 +856,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -1019,7 +1018,7 @@ mod babbage_tests { }; let altered_address: ShelleyAddress = ShelleyAddress::new( old_shelley_address.network(), - ShelleyPaymentPart::Script(old_shelley_address.payment().as_hash().clone()), + ShelleyPaymentPart::Script(*old_shelley_address.payment().as_hash()), old_shelley_address.delegation().clone(), ); let tx_in = mtx @@ -1303,7 +1302,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -1346,11 +1345,11 @@ mod babbage_tests { )]; let utxos: UTxOs = mk_utxo_for_babbage_tx(&mtx.transaction_body, tx_outs_info); let mut tx_body: MintedTransactionBody = (*mtx.transaction_body).clone(); - tx_body.fee = tx_body.fee - 1; + tx_body.fee -= 1; let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -1480,7 +1479,7 @@ mod babbage_tests { let utxos: UTxOs = mk_utxo_for_babbage_tx(&mtx.transaction_body, tx_outs_info); let mut tx_body: MintedTransactionBody = (*mtx.transaction_body).clone(); let (first_output, rest): (&MintedTransactionOutput, &[MintedTransactionOutput]) = - (&tx_body.outputs).split_first().unwrap(); + tx_body.outputs.split_first().unwrap(); let (address_bytes, val): (Bytes, Value) = match first_output { PseudoTransactionOutput::Legacy(output) => { (output.address.clone(), output.amount.clone()) @@ -1511,7 +1510,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -1561,7 +1560,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_body, &mut tx_buf); mtx.transaction_body = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -1809,7 +1808,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_wits, &mut tx_buf); mtx.transaction_witness_set = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -1977,7 +1976,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_wits, &mut tx_buf); mtx.transaction_witness_set = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -2066,7 +2065,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_wits, &mut tx_buf); mtx.transaction_witness_set = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -2156,12 +2155,12 @@ mod babbage_tests { let mut new_datum_buf: Vec = Vec::new(); let _ = encode(new_datum, &mut new_datum_buf); let keep_raw_new_datum: KeepRaw = - Decode::decode(&mut Decoder::new(&new_datum_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(new_datum_buf.as_slice()), &mut ()).unwrap(); tx_wits.plutus_data = Some(vec![old_datum, keep_raw_new_datum]); let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_wits, &mut tx_buf); mtx.transaction_witness_set = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -2254,7 +2253,7 @@ mod babbage_tests { let mut tx_buf: Vec = Vec::new(); let _ = encode(tx_wits, &mut tx_buf); mtx.transaction_witness_set = - Decode::decode(&mut Decoder::new(&tx_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, @@ -2344,7 +2343,7 @@ mod babbage_tests { let mut tx_witness_set_buf: Vec = Vec::new(); let _ = encode(tx_witness_set, &mut tx_witness_set_buf); mtx.transaction_witness_set = - Decode::decode(&mut Decoder::new(&tx_witness_set_buf.as_slice()), &mut ()).unwrap(); + Decode::decode(&mut Decoder::new(tx_witness_set_buf.as_slice()), &mut ()).unwrap(); let metx: MultiEraTx = MultiEraTx::from_babbage(&mtx); let acnt = AccountState { treasury: 261_254_564_000_000, diff --git a/pallas-applying/tests/common.rs b/pallas-applying/tests/common.rs index 10cd8dd9..e1b72422 100644 --- a/pallas-applying/tests/common.rs +++ b/pallas-applying/tests/common.rs @@ -24,11 +24,11 @@ pub fn minted_tx_from_cbor(tx_cbor: &[u8]) -> MintedTx<'_> { } pub fn babbage_minted_tx_from_cbor(tx_cbor: &[u8]) -> BabbageMintedTx<'_> { - pallas_codec::minicbor::decode::(&tx_cbor[..]).unwrap() + pallas_codec::minicbor::decode::(tx_cbor).unwrap() } -pub fn minted_tx_payload_from_cbor<'a>(tx_cbor: &'a Vec) -> MintedTxPayload<'a> { - pallas_codec::minicbor::decode::(&tx_cbor[..]).unwrap() +pub fn minted_tx_payload_from_cbor(tx_cbor: &[u8]) -> MintedTxPayload<'_> { + pallas_codec::minicbor::decode::(tx_cbor).unwrap() } pub fn mk_utxo_for_byron_tx<'a>(tx: &Tx, tx_outs_info: &[(String, u64)]) -> UTxOs<'a> { diff --git a/pallas-codec/src/utils.rs b/pallas-codec/src/utils.rs index 46fadb0b..3c17f822 100644 --- a/pallas-codec/src/utils.rs +++ b/pallas-codec/src/utils.rs @@ -1120,7 +1120,7 @@ impl<'b, T> KeepRaw<'b, T> { } } -impl<'b, T> Deref for KeepRaw<'b, T> { +impl Deref for KeepRaw<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { diff --git a/pallas-crypto/src/hash/hasher.rs b/pallas-crypto/src/hash/hasher.rs index 6ac38195..41df99f7 100644 --- a/pallas-crypto/src/hash/hasher.rs +++ b/pallas-crypto/src/hash/hasher.rs @@ -134,7 +134,7 @@ impl Write for Hasher { } */ -impl<'a, const BITS: usize> minicbor::encode::Write for &'a mut Hasher { +impl minicbor::encode::Write for &mut Hasher { type Error = std::convert::Infallible; #[inline] diff --git a/pallas-crypto/src/hash/serde.rs b/pallas-crypto/src/hash/serde.rs index f8acad6f..11d4ec19 100644 --- a/pallas-crypto/src/hash/serde.rs +++ b/pallas-crypto/src/hash/serde.rs @@ -17,7 +17,7 @@ impl Serialize for Hash { struct HashVisitor {} -impl<'de, const BYTES: usize> Visitor<'de> for HashVisitor { +impl Visitor<'_> for HashVisitor { type Value = Hash; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/pallas-crypto/src/nonce/mod.rs b/pallas-crypto/src/nonce/mod.rs index 8b59d79d..acc92e59 100644 --- a/pallas-crypto/src/nonce/mod.rs +++ b/pallas-crypto/src/nonce/mod.rs @@ -48,27 +48,21 @@ mod tests { #[test] fn test_epoch_nonce() { - let nc_values = vec![ - hex::decode("e86e133bd48ff5e79bec43af1ac3e348b539172f33e502d2c96735e8c51bd04d") + let nc_values = [hex::decode("e86e133bd48ff5e79bec43af1ac3e348b539172f33e502d2c96735e8c51bd04d") .unwrap(), hex::decode("d1340a9c1491f0face38d41fd5c82953d0eb48320d65e952414a0c5ebaf87587") - .unwrap(), - ]; - let nh_values = vec![ - hex::decode("d7a1ff2a365abed59c9ae346cba842b6d3df06d055dba79a113e0704b44cc3e9") + .unwrap()]; + let nh_values = [hex::decode("d7a1ff2a365abed59c9ae346cba842b6d3df06d055dba79a113e0704b44cc3e9") .unwrap(), hex::decode("ee91d679b0a6ce3015b894c575c799e971efac35c7a8cbdc2b3f579005e69abd") - .unwrap(), - ]; + .unwrap()]; let ee = hex::decode("d982e06fd33e7440b43cefad529b7ecafbaa255e38178ad4189a37e4ce9bf1fa") .unwrap(); let extra_entropy_values: Vec> = vec![None, Some(&ee)]; - let expected_epoch_nonces = vec![ - hex::decode("e536a0081ddd6d19786e9d708a85819a5c3492c0da7349f59c8ad3e17e4acd98") + let expected_epoch_nonces = [hex::decode("e536a0081ddd6d19786e9d708a85819a5c3492c0da7349f59c8ad3e17e4acd98") .unwrap(), hex::decode("0022cfa563a5328c4fb5c8017121329e964c26ade5d167b1bd9b2ec967772b60") - .unwrap(), - ]; + .unwrap()]; for (nc_value, nh_value, extra_entropy_value, expected_epoch_nonce) in izip!( nc_values.iter(), diff --git a/pallas-hardano/src/storage/immutable/mod.rs b/pallas-hardano/src/storage/immutable/mod.rs index 42f4bcd1..edf4d042 100644 --- a/pallas-hardano/src/storage/immutable/mod.rs +++ b/pallas-hardano/src/storage/immutable/mod.rs @@ -565,7 +565,7 @@ mod tests { } fn read_full_snapshot(path: &Path) { - let reader = super::read_blocks(&path).unwrap(); + let reader = super::read_blocks(path).unwrap(); let mut count = 0; let mut last_slot = None; diff --git a/pallas-math/src/math_dashu.rs b/pallas-math/src/math_dashu.rs index d17c08c6..560b30af 100644 --- a/pallas-math/src/math_dashu.rs +++ b/pallas-math/src/math_dashu.rs @@ -117,7 +117,7 @@ impl Neg for Decimal { } // Implement Neg for a reference to Decimal -impl<'a> Neg for &'a Decimal { +impl Neg for &Decimal { type Output = Decimal; fn neg(self) -> Self::Output { @@ -138,7 +138,7 @@ impl Abs for Decimal { } // Implement Abs for a reference to Decimal -impl<'a> Abs for &'a Decimal { +impl Abs for &Decimal { type Output = Decimal; fn abs(self) -> Self::Output { @@ -167,7 +167,7 @@ impl MulAssign for Decimal { } // Implement Mul for a reference to Decimal -impl<'a, 'b> Mul<&'b Decimal> for &'a Decimal { +impl<'b> Mul<&'b Decimal> for &Decimal { type Output = Decimal; fn mul(self, rhs: &'b Decimal) -> Self::Output { @@ -178,7 +178,7 @@ impl<'a, 'b> Mul<&'b Decimal> for &'a Decimal { } } -impl<'a, 'b> MulAssign<&'b Decimal> for &'a mut Decimal { +impl<'b> MulAssign<&'b Decimal> for &mut Decimal { fn mul_assign(&mut self, rhs: &'b Decimal) { self.data *= &rhs.data; scale(&mut self.data); @@ -203,7 +203,7 @@ impl DivAssign for Decimal { } // Implement Div for a reference to Decimal -impl<'a, 'b> Div<&'b Decimal> for &'a Decimal { +impl<'b> Div<&'b Decimal> for &Decimal { type Output = Decimal; fn div(self, rhs: &'b Decimal) -> Self::Output { @@ -213,7 +213,7 @@ impl<'a, 'b> Div<&'b Decimal> for &'a Decimal { } } -impl<'a, 'b> DivAssign<&'b Decimal> for &'a mut Decimal { +impl<'b> DivAssign<&'b Decimal> for &mut Decimal { fn div_assign(&mut self, rhs: &'b Decimal) { let temp = self.data.clone(); div(&mut self.data, &temp, &rhs.data); @@ -237,7 +237,7 @@ impl SubAssign for Decimal { } // Implement Sub for a reference to Decimal -impl<'a, 'b> Sub<&'b Decimal> for &'a Decimal { +impl<'b> Sub<&'b Decimal> for &Decimal { type Output = Decimal; fn sub(self, rhs: &'b Decimal) -> Self::Output { @@ -247,7 +247,7 @@ impl<'a, 'b> Sub<&'b Decimal> for &'a Decimal { } } -impl<'a, 'b> SubAssign<&'b Decimal> for &'a mut Decimal { +impl<'b> SubAssign<&'b Decimal> for &mut Decimal { fn sub_assign(&mut self, rhs: &'b Decimal) { self.data -= &rhs.data; } @@ -270,7 +270,7 @@ impl AddAssign for Decimal { } // Implement Add for a reference to Decimal -impl<'a, 'b> Add<&'b Decimal> for &'a Decimal { +impl<'b> Add<&'b Decimal> for &Decimal { type Output = Decimal; fn add(self, rhs: &'b Decimal) -> Self::Output { @@ -280,7 +280,7 @@ impl<'a, 'b> Add<&'b Decimal> for &'a Decimal { } } -impl<'a, 'b> AddAssign<&'b Decimal> for &'a mut Decimal { +impl<'b> AddAssign<&'b Decimal> for &mut Decimal { fn add_assign(&mut self, rhs: &'b Decimal) { self.data += &rhs.data; } diff --git a/pallas-traverse/src/assets.rs b/pallas-traverse/src/assets.rs index 8106221e..7c249179 100644 --- a/pallas-traverse/src/assets.rs +++ b/pallas-traverse/src/assets.rs @@ -2,7 +2,7 @@ use pallas_crypto::hash::Hash; use crate::{MultiEraAsset, MultiEraPolicyAssets}; -impl<'b> MultiEraPolicyAssets<'b> { +impl MultiEraPolicyAssets<'_> { pub fn policy(&self) -> &Hash<28> { match self { MultiEraPolicyAssets::AlonzoCompatibleMint(x, _) => x, @@ -74,7 +74,7 @@ impl<'b> MultiEraPolicyAssets<'b> { } } -impl<'b> MultiEraAsset<'b> { +impl MultiEraAsset<'_> { pub fn policy(&self) -> &Hash<28> { match self { MultiEraAsset::AlonzoCompatibleMint(x, ..) => x, diff --git a/pallas-traverse/src/auxiliary.rs b/pallas-traverse/src/auxiliary.rs index 5e84f2cb..1b7b6caa 100644 --- a/pallas-traverse/src/auxiliary.rs +++ b/pallas-traverse/src/auxiliary.rs @@ -4,7 +4,7 @@ use pallas_primitives::alonzo; use crate::MultiEraTx; -impl<'b> MultiEraTx<'b> { +impl MultiEraTx<'_> { pub fn aux_plutus_v1_scripts(&self) -> &[alonzo::PlutusScript<1>] { if let Some(aux_data) = self.aux_data() { if let alonzo::AuxiliaryData::PostAlonzo(x) = aux_data.deref() { diff --git a/pallas-traverse/src/cert.rs b/pallas-traverse/src/cert.rs index 0a330e9a..a2786c30 100644 --- a/pallas-traverse/src/cert.rs +++ b/pallas-traverse/src/cert.rs @@ -2,7 +2,7 @@ use pallas_primitives::{alonzo, conway}; use crate::MultiEraCert; -impl<'b> MultiEraCert<'b> { +impl MultiEraCert<'_> { pub fn as_alonzo(&self) -> Option<&alonzo::Certificate> { match self { MultiEraCert::AlonzoCompatible(x) => Some(x), diff --git a/pallas-traverse/src/meta.rs b/pallas-traverse/src/meta.rs index 9f0101bf..9247b45a 100644 --- a/pallas-traverse/src/meta.rs +++ b/pallas-traverse/src/meta.rs @@ -2,7 +2,7 @@ use pallas_primitives::alonzo; use crate::MultiEraMeta; -impl<'b> MultiEraMeta<'b> { +impl MultiEraMeta<'_> { pub fn as_alonzo(&self) -> Option<&alonzo::Metadata> { match self { Self::AlonzoCompatible(x) => Some(x), diff --git a/pallas-traverse/src/signers.rs b/pallas-traverse/src/signers.rs index c691d4ae..f149286f 100644 --- a/pallas-traverse/src/signers.rs +++ b/pallas-traverse/src/signers.rs @@ -9,7 +9,7 @@ impl Default for MultiEraSigners<'_> { } } -impl<'b> MultiEraSigners<'b> { +impl MultiEraSigners<'_> { pub fn as_alonzo(&self) -> Option<&alonzo::RequiredSigners> { match self { Self::AlonzoCompatible(x) => Some(x), diff --git a/pallas-traverse/src/size.rs b/pallas-traverse/src/size.rs index b978d1e5..b6151dd8 100644 --- a/pallas-traverse/src/size.rs +++ b/pallas-traverse/src/size.rs @@ -2,7 +2,7 @@ use pallas_codec::utils::Nullable; use crate::{MultiEraBlock, MultiEraTx}; -impl<'b> MultiEraTx<'b> { +impl MultiEraTx<'_> { fn aux_data_size(&self) -> usize { match self { MultiEraTx::AlonzoCompatible(x, _) => match &x.auxiliary_data { @@ -44,7 +44,7 @@ impl<'b> MultiEraTx<'b> { } } -impl<'b> MultiEraBlock<'b> { +impl MultiEraBlock<'_> { pub fn body_size(&self) -> Option { match self { MultiEraBlock::AlonzoCompatible(x, _) => { diff --git a/pallas-traverse/src/time.rs b/pallas-traverse/src/time.rs index a5b8c0c7..46cf0329 100644 --- a/pallas-traverse/src/time.rs +++ b/pallas-traverse/src/time.rs @@ -117,7 +117,7 @@ impl GenesisValues { } } -impl<'a> MultiEraBlock<'a> { +impl MultiEraBlock<'_> { pub fn epoch(&self, genesis: &GenesisValues) -> (Epoch, SubSlot) { match self { MultiEraBlock::EpochBoundary(x) => (x.header.consensus_data.epoch_id, 0), diff --git a/pallas-traverse/src/withdrawals.rs b/pallas-traverse/src/withdrawals.rs index e840c67a..2d2f8cd4 100644 --- a/pallas-traverse/src/withdrawals.rs +++ b/pallas-traverse/src/withdrawals.rs @@ -2,7 +2,7 @@ use pallas_primitives::alonzo; use crate::MultiEraWithdrawals; -impl<'b> MultiEraWithdrawals<'b> { +impl MultiEraWithdrawals<'_> { pub fn as_alonzo(&self) -> Option<&alonzo::Withdrawals> { match self { Self::AlonzoCompatible(x) => Some(x), diff --git a/pallas-txbuilder/src/scriptdata.rs b/pallas-txbuilder/src/scriptdata.rs index 72c08023..da4b5d1f 100644 --- a/pallas-txbuilder/src/scriptdata.rs +++ b/pallas-txbuilder/src/scriptdata.rs @@ -121,7 +121,7 @@ mod tests { }); fn assert_script_data_hash_matches(bytes: &[u8], language_view: &LanguageView) { - let tx = MultiEraTx::decode(&bytes).unwrap(); + let tx = MultiEraTx::decode(bytes).unwrap(); let tx = tx.as_conway().unwrap(); let witness = conway::WitnessSet::from(tx.transaction_witness_set.clone().unwrap()); diff --git a/pallas-txbuilder/src/transaction/serialise.rs b/pallas-txbuilder/src/transaction/serialise.rs index 5a0a1f08..e60008f3 100644 --- a/pallas-txbuilder/src/transaction/serialise.rs +++ b/pallas-txbuilder/src/transaction/serialise.rs @@ -33,7 +33,7 @@ impl<'de> Deserialize<'de> for Bytes32 { struct Bytes32Visitor; -impl<'de> Visitor<'de> for Bytes32Visitor { +impl Visitor<'_> for Bytes32Visitor { type Value = Bytes32; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -73,7 +73,7 @@ impl<'de> Deserialize<'de> for Hash28 { struct Hash28Visitor; -impl<'de> Visitor<'de> for Hash28Visitor { +impl Visitor<'_> for Hash28Visitor { type Value = Hash28; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -113,7 +113,7 @@ impl<'de> Deserialize<'de> for Bytes { struct BytesVisitor; -impl<'de> Visitor<'de> for BytesVisitor { +impl Visitor<'_> for BytesVisitor { type Value = Bytes; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -265,7 +265,7 @@ impl<'de> Deserialize<'de> for RedeemerPurpose { struct RedeemerPurposeVisitor; -impl<'de> Visitor<'de> for RedeemerPurposeVisitor { +impl Visitor<'_> for RedeemerPurposeVisitor { type Value = RedeemerPurpose; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -333,7 +333,7 @@ impl<'de> Deserialize<'de> for Address { struct AddressVisitor; -impl<'de> Visitor<'de> for AddressVisitor { +impl Visitor<'_> for AddressVisitor { type Value = Address; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -370,7 +370,7 @@ impl<'de> Deserialize<'de> for Bytes64 { struct Bytes64Visitor; -impl<'de> Visitor<'de> for Bytes64Visitor { +impl Visitor<'_> for Bytes64Visitor { type Value = Bytes64; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/pallas-utxorpc/src/lib.rs b/pallas-utxorpc/src/lib.rs index faee6fe9..ea9c02bf 100644 --- a/pallas-utxorpc/src/lib.rs +++ b/pallas-utxorpc/src/lib.rs @@ -65,7 +65,7 @@ impl Mapper { u5c::Redeemer { purpose: self.map_purpose(&x.tag()).into(), payload: self.map_plutus_datum(x.data()).into(), - index: x.index().into(), + index: x.index(), ex_units: Some(u5c::ExUnits { steps: x.ex_units().steps, memory: x.ex_units().mem, @@ -613,7 +613,7 @@ mod tests { // ) // .unwrap(); - let expected: serde_json::Value = serde_json::from_str(&json_str).unwrap(); + let expected: serde_json::Value = serde_json::from_str(json_str).unwrap(); assert_eq!(expected, current) }