Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 5080b8a

Browse files
authored
Fix clippy (#83)
1 parent 666b0b7 commit 5080b8a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

token/src/instruction.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ pub fn transfer(
357357
accounts.push(AccountMeta::new(*destination_pubkey, false));
358358
accounts.push(AccountMeta::new_readonly(
359359
*authority_pubkey,
360-
signer_pubkeys.len() == 0,
360+
signer_pubkeys.is_empty(),
361361
));
362362
for signer_pubkey in signer_pubkeys.iter() {
363363
accounts.push(AccountMeta::new(**signer_pubkey, true));
@@ -388,7 +388,7 @@ pub fn approve(
388388
}
389389
accounts.push(AccountMeta::new_readonly(
390390
*owner_pubkey,
391-
signer_pubkeys.len() == 0,
391+
signer_pubkeys.is_empty(),
392392
));
393393
for signer_pubkey in signer_pubkeys.iter() {
394394
accounts.push(AccountMeta::new(**signer_pubkey, true));
@@ -416,7 +416,7 @@ pub fn set_owner(
416416
accounts.push(AccountMeta::new_readonly(*new_owner_pubkey, false));
417417
accounts.push(AccountMeta::new_readonly(
418418
*owner_pubkey,
419-
signer_pubkeys.len() == 0,
419+
signer_pubkeys.is_empty(),
420420
));
421421
for signer_pubkey in signer_pubkeys.iter() {
422422
accounts.push(AccountMeta::new(**signer_pubkey, true));
@@ -445,7 +445,7 @@ pub fn mint_to(
445445
accounts.push(AccountMeta::new(*account_pubkey, false));
446446
accounts.push(AccountMeta::new_readonly(
447447
*owner_pubkey,
448-
signer_pubkeys.len() == 0,
448+
signer_pubkeys.is_empty(),
449449
));
450450
for signer_pubkey in signer_pubkeys.iter() {
451451
accounts.push(AccountMeta::new(**signer_pubkey, true));
@@ -474,7 +474,7 @@ pub fn burn(
474474
accounts.push(AccountMeta::new(*mint_pubkey, false));
475475
accounts.push(AccountMeta::new_readonly(
476476
*authority_pubkey,
477-
signer_pubkeys.len() == 0,
477+
signer_pubkeys.is_empty(),
478478
));
479479
for signer_pubkey in signer_pubkeys.iter() {
480480
accounts.push(AccountMeta::new(**signer_pubkey, true));
@@ -489,9 +489,5 @@ pub fn burn(
489489

490490
/// Utility function that checks index is between MIN_SIGNERS and MAX_SIGNERS
491491
pub fn is_valid_signer_index(index: usize) -> bool {
492-
if index < MIN_SIGNERS || index > MAX_SIGNERS {
493-
false
494-
} else {
495-
true
496-
}
492+
!(index < MIN_SIGNERS || index > MAX_SIGNERS)
497493
}

0 commit comments

Comments
 (0)