Skip to content

Commit a292e03

Browse files
clippy
1 parent 75bf6b9 commit a292e03

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/account.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ pub(crate) fn sign(message: &[u8], secret_key: &[u8; SECRET_KEY_LENGTH]) -> [u8;
4848
.compress()
4949
.to_bytes();
5050

51-
let ed_pubkey = &constants::ED25519_BASEPOINT_POINT * &Scalar::from_bits(*secret_key);
51+
let ed_pubkey = constants::ED25519_BASEPOINT_POINT * Scalar::from_bits(*secret_key);
5252
let pubkey = ed_pubkey.compress().to_bytes();
5353

5454
hash = Sha512::default();
5555
hash.input(&r);
5656
hash.input(&pubkey);
5757
hash.input(message);
58-
let s = &(&Scalar::from_hash(hash) * &Scalar::from_bits(*secret_key)) + &rsc;
58+
let s = (Scalar::from_hash(hash) * Scalar::from_bits(*secret_key)) + rsc;
5959

6060
let sign = pubkey[31] & 0x80;
6161
let mut result = [0; SIGNATURE_LENGTH];

src/bytebuffer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ impl Buffer {
1010
Buffer { buf: Vec::new() }
1111
}
1212

13+
#[allow(dead_code)]
1314
pub fn from_bytes(b: &[u8]) -> Buffer {
1415
Buffer { buf: Vec::from(b) }
1516
}
@@ -55,9 +56,9 @@ impl Buffer {
5556
self.byte(0x02)
5657
.byte(chain_id)
5758
.size(recipient.len())
58-
.bytes(&recipient.as_bytes())
59+
.bytes(recipient.as_bytes())
5960
} else {
60-
self.bytes(&recipient.from_base58().unwrap().as_slice())
61+
self.bytes(recipient.from_base58().unwrap().as_slice())
6162
}
6263
}
6364

src/transaction.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub struct Transaction<'a> {
4141
use transaction_data::TransactionData::*;
4242

4343
impl<'a> Transaction<'a> {
44+
#[allow(clippy::too_many_arguments)]
4445
pub fn new_issue(
4546
sender_public_key: &'a PublicKeyAccount,
4647
name: &'a str,
@@ -71,6 +72,7 @@ impl<'a> Transaction<'a> {
7172
}
7273
}
7374

75+
#[allow(clippy::too_many_arguments)]
7476
pub fn new_transfer(
7577
sender_public_key: &'a PublicKeyAccount,
7678
recipient: &'a Address,
@@ -328,8 +330,8 @@ impl<'a> Transaction<'a> {
328330
attachment,
329331
} => buf
330332
.bytes(self.sender_public_key.to_bytes())
331-
.asset_opt(&asset)
332-
.asset_opt(&fee_asset)
333+
.asset_opt(asset)
334+
.asset_opt(fee_asset)
333335
.long(self.timestamp)
334336
.long(amount)
335337
.long(self.fee)
@@ -343,7 +345,7 @@ impl<'a> Transaction<'a> {
343345
} => buf
344346
.byte(chain_id)
345347
.bytes(self.sender_public_key.to_bytes())
346-
.asset(&asset)
348+
.asset(asset)
347349
.long(quantity)
348350
.boolean(reissuable)
349351
.long(self.fee)
@@ -355,7 +357,7 @@ impl<'a> Transaction<'a> {
355357
} => buf
356358
.byte(chain_id)
357359
.bytes(self.sender_public_key.to_bytes())
358-
.asset(&asset)
360+
.asset(asset)
359361
.long(quantity)
360362
.long(self.fee)
361363
.long(self.timestamp),
@@ -390,7 +392,7 @@ impl<'a> Transaction<'a> {
390392
attachment,
391393
} => {
392394
buf.bytes(self.sender_public_key.to_bytes())
393-
.asset_opt(&asset)
395+
.asset_opt(asset)
394396
.size(transfers.len());
395397
for (addr, amt) in transfers {
396398
buf.bytes(addr.to_bytes()).long(*amt);

0 commit comments

Comments
 (0)