Update according to the latest clippy

This commit is contained in:
Luke Parker
2022-09-04 21:23:38 -04:00
parent 73566e756d
commit 31b64b3082
7 changed files with 14 additions and 14 deletions

View File

@@ -43,8 +43,8 @@ impl ClsagInput {
// Doesn't include global output indexes as CLSAG doesn't care and won't be affected by it
// They're just a unreliable reference to this data which will be included in the message
// if in use
ring.extend(&pair[0].compress().to_bytes());
ring.extend(&pair[1].compress().to_bytes());
ring.extend(pair[0].compress().to_bytes());
ring.extend(pair[1].compress().to_bytes());
}
transcript.append_message(b"ring", &ring);

View File

@@ -160,14 +160,14 @@ impl Rpc {
.rpc_call(
"get_transactions",
Some(json!({
"txs_hashes": hashes.iter().map(|hash| hex::encode(&hash)).collect::<Vec<_>>()
"txs_hashes": hashes.iter().map(hex::encode).collect::<Vec<_>>()
})),
)
.await?;
if !txs.missed_tx.is_empty() {
Err(RpcError::TransactionsNotFound(
txs.missed_tx.iter().map(|hash| hex::decode(&hash).unwrap().try_into().unwrap()).collect(),
txs.missed_tx.iter().map(|hash| hex::decode(hash).unwrap().try_into().unwrap()).collect(),
))?;
}

View File

@@ -277,7 +277,7 @@ impl Transaction {
serialized.clear();
self.rct_signatures.prunable.signature_serialize(&mut serialized).unwrap();
sig_hash.extend(&hash(&serialized));
sig_hash.extend(hash(&serialized));
hash(&sig_hash)
}

View File

@@ -22,7 +22,7 @@ pub struct AbsoluteId {
impl AbsoluteId {
pub fn serialize(&self) -> Vec<u8> {
let mut res = Vec::with_capacity(32 + 1);
res.extend(&self.tx);
res.extend(self.tx);
res.push(self.o);
res
}
@@ -80,10 +80,10 @@ impl Metadata {
res.extend(self.subaddress.1.to_le_bytes());
res.extend(self.payment_id);
if let Some(data) = self.arbitrary_data.as_ref() {
res.extend(&[1, u8::try_from(data.len()).unwrap()]);
res.extend([1, u8::try_from(data.len()).unwrap()]);
res.extend(data);
} else {
res.extend(&[0]);
res.extend([0]);
}
res
}
@@ -173,7 +173,7 @@ impl SpendableOutput {
pub fn serialize(&self) -> Vec<u8> {
let mut serialized = self.output.serialize();
serialized.extend(&self.global_index.to_le_bytes());
serialized.extend(self.global_index.to_le_bytes());
serialized
}