Skip to content

Commit 629b873

Browse files
committed
fix clippy
1 parent 02fa1b9 commit 629b873

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

candy-machine/program/tests/core/master_edition_v2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl MasterEditionV2 {
4040
}
4141
}
4242

43+
#[allow(dead_code)]
4344
pub async fn get_data(
4445
&self,
4546
context: &mut ProgramTestContext,
@@ -48,6 +49,7 @@ impl MasterEditionV2 {
4849
try_from_slice_unchecked(&account.data).unwrap()
4950
}
5051

52+
#[allow(dead_code)]
5153
pub async fn get_data_from_account(
5254
context: &mut ProgramTestContext,
5355
pubkey: &Pubkey,

candy-machine/program/tests/core/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl Metadata {
4141
}
4242
}
4343

44+
#[allow(dead_code)]
4445
pub async fn get_data(
4546
&self,
4647
context: &mut ProgramTestContext,

candy-machine/program/tests/core/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use crate::core::master_edition_v2::MasterEditionV2;
1616

1717
pub mod master_edition_v2;
1818
pub mod metadata;
19-
2019
/// Perform native lamports transfer.
20+
#[allow(dead_code)]
2121
pub async fn transfer_lamports(
2222
client: &mut ProgramTestContext,
2323
wallet: &Keypair,
@@ -101,11 +101,13 @@ pub async fn assert_acount_empty(context: &mut ProgramTestContext, pubkey: &Pubk
101101
assert_eq!(account, None);
102102
}
103103

104+
#[allow(dead_code)]
104105
pub async fn get_mint(context: &mut ProgramTestContext, pubkey: &Pubkey) -> Mint {
105106
let account = get_account(context, pubkey).await;
106107
Mint::unpack(&account.data).unwrap()
107108
}
108109

110+
#[allow(dead_code)]
109111
pub async fn create_token_account(
110112
context: &mut ProgramTestContext,
111113
account: &Keypair,
@@ -210,6 +212,7 @@ pub async fn mint_to_wallets(
210212
) -> transport::Result<Vec<Pubkey>> {
211213
let mut atas = Vec::with_capacity(allocations.len());
212214

215+
#[allow(clippy::needless_range_loop)]
213216
for i in 0..allocations.len() {
214217
let ata = create_associated_token_account(context, &allocations[i].0, mint_pubkey).await?;
215218
// println!("Minting to wallet {}", i);
@@ -263,6 +266,7 @@ pub async fn mint_tokens(
263266
context.banks_client.process_transaction(tx).await
264267
}
265268

269+
#[allow(dead_code)]
266270
pub async fn transfer(
267271
context: &mut ProgramTestContext,
268272
mint: &Pubkey,

candy-machine/program/tests/utils/candy_manager.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{cmp::min, fmt::Debug, thread::sleep, time::Duration};
1+
use std::fmt::Debug;
22

33
use anchor_lang::AccountDeserialize;
44
use mpl_token_metadata::pda::find_collection_authority_account;
@@ -18,9 +18,9 @@ use mpl_candy_machine::{
1818
use crate::{
1919
add_all_config_lines, airdrop, clone_keypair,
2020
core::{
21-
assert_acount_empty, clone_pubkey, create_mint, get_balance, get_mint, get_token_account,
22-
get_token_balance, master_edition_v2::MasterEditionV2 as MasterEditionManager, metadata,
23-
mint_to_wallets, prepare_nft,
21+
assert_acount_empty, clone_pubkey, create_mint, get_balance, get_token_balance,
22+
master_edition_v2::MasterEditionV2 as MasterEditionManager, metadata, mint_to_wallets,
23+
prepare_nft,
2424
},
2525
get_account,
2626
helper_transactions::{remove_collection, set_collection},
@@ -82,6 +82,7 @@ impl Clone for CollectionInfo {
8282
}
8383

8484
impl CollectionInfo {
85+
#[allow(dead_code)]
8586
pub fn new(
8687
set: bool,
8788
pda: Pubkey,
@@ -157,6 +158,7 @@ pub struct TokenInfo {
157158
}
158159

159160
impl TokenInfo {
161+
#[allow(dead_code)]
160162
pub fn new(
161163
set: bool,
162164
mint: Pubkey,
@@ -252,6 +254,7 @@ impl Default for WhitelistConfig {
252254
}
253255

254256
impl WhitelistInfo {
257+
#[allow(dead_code)]
255258
pub fn new(
256259
set: bool,
257260
mint: Pubkey,
@@ -449,6 +452,7 @@ impl CandyManager {
449452
Ok(())
450453
}
451454

455+
#[allow(dead_code)]
452456
pub async fn remove_collection(
453457
&mut self,
454458
context: &mut ProgramTestContext,

candy-machine/program/tests/utils/configs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub const DEFAULT_PRICE: u64 = 1e9 as u64;
1010
pub const ITEMS_AVAILABLE: u64 = 11;
1111
pub const DEFAULT_SYMBOL: &str = "SYMBOL";
1212

13+
#[allow(dead_code)]
1314
pub fn quick_config(creator: Pubkey) -> CandyMachineData {
1415
custom_config(creator, None, true, true, None, None, None, None)
1516
}

candy-machine/program/tests/utils/helper_transactions.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use solana_program::{
66
system_instruction,
77
};
88
use solana_program_test::*;
9-
use solana_sdk::{
10-
commitment_config::CommitmentLevel, signature::Keypair, transaction::Transaction, transport,
11-
};
9+
use solana_sdk::{signature::Keypair, transaction::Transaction, transport};
1210

1311
use mpl_candy_machine::{
1412
constants::{CONFIG_ARRAY_START, CONFIG_LINE_SIZE},
@@ -17,7 +15,7 @@ use mpl_candy_machine::{
1715
};
1816

1917
use crate::{
20-
core::{get_balance, master_edition_v2::MasterEditionV2},
18+
core::master_edition_v2::MasterEditionV2,
2119
utils::{
2220
candy_manager::{CollectionInfo, TokenInfo, WhitelistInfo},
2321
make_config_lines,

0 commit comments

Comments
 (0)