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

Commit 5b0e0c1

Browse files
Single use stmts (#2850)
1 parent 1f77ba0 commit 5b0e0c1

File tree

4 files changed

+41
-36
lines changed

4 files changed

+41
-36
lines changed

associated-token-account/program/src/instruction.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
//! Program instructions
22
3-
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
4-
use solana_program::{
5-
instruction::{AccountMeta, Instruction},
6-
pubkey::Pubkey,
3+
use {
4+
borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
5+
solana_program::{
6+
instruction::{AccountMeta, Instruction},
7+
pubkey::Pubkey,
8+
},
79
};
810

911
use crate::{get_associated_token_address, id};

associated-token-account/program/src/processor.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
//! Program state processor
22
3-
use crate::*;
4-
use crate::{
5-
instruction::AssociatedTokenAccountInstruction,
6-
tools::account::{create_pda_account, get_account_len},
7-
};
8-
use borsh::BorshDeserialize;
9-
use solana_program::{
10-
account_info::{next_account_info, AccountInfo},
11-
entrypoint::ProgramResult,
12-
msg,
13-
program::invoke,
14-
program_error::ProgramError,
15-
pubkey::Pubkey,
16-
rent::Rent,
17-
sysvar::Sysvar,
3+
use {
4+
crate::{
5+
instruction::AssociatedTokenAccountInstruction,
6+
tools::account::{create_pda_account, get_account_len},
7+
*,
8+
},
9+
borsh::BorshDeserialize,
10+
solana_program::{
11+
account_info::{next_account_info, AccountInfo},
12+
entrypoint::ProgramResult,
13+
msg,
14+
program::invoke,
15+
program_error::ProgramError,
16+
pubkey::Pubkey,
17+
rent::Rent,
18+
sysvar::Sysvar,
19+
},
1820
};
1921

2022
/// Instruction processor

associated-token-account/program/tests/process_create_associated_token_account.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33

44
mod program_test;
55

6-
use solana_program::{
7-
instruction::*, program_pack::Pack, pubkey::Pubkey, system_instruction, sysvar,
8-
};
9-
use solana_program_test::*;
10-
use solana_sdk::{
11-
signature::Signer,
12-
transaction::{Transaction, TransactionError},
13-
};
14-
use spl_associated_token_account::{
15-
get_associated_token_address, instruction::create_associated_token_account,
6+
use {
7+
program_test::program_test,
8+
solana_program::{
9+
instruction::*, program_pack::Pack, pubkey::Pubkey, system_instruction, sysvar,
10+
},
11+
solana_program_test::*,
12+
solana_sdk::{
13+
signature::Signer,
14+
transaction::{Transaction, TransactionError},
15+
},
16+
spl_associated_token_account::{
17+
get_associated_token_address, instruction::create_associated_token_account,
18+
},
1619
};
1720

1821
#[allow(deprecated)]
1922
use spl_associated_token_account::create_associated_token_account as deprecated_create_associated_token_account;
2023

21-
use program_test::program_test;
22-
2324
#[tokio::test]
2425
async fn test_associated_token_address() {
2526
let wallet_address = Pubkey::new_unique();

associated-token-account/program/tests/program_test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use solana_program::pubkey::Pubkey;
2-
use solana_program_test::ProgramTest;
3-
4-
use solana_program_test::*;
5-
use spl_associated_token_account::{id, processor::process_instruction};
1+
use {
2+
solana_program::pubkey::Pubkey,
3+
solana_program_test::{ProgramTest, *},
4+
spl_associated_token_account::{id, processor::process_instruction},
5+
};
66

77
pub fn program_test(token_mint_address: Pubkey, use_latest_spl_token: bool) -> ProgramTest {
88
let mut pc = ProgramTest::new(

0 commit comments

Comments
 (0)