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

Commit 512497a

Browse files
Solana Maintainersmvines
authored andcommitted
use cleanup
1 parent d9fd11a commit 512497a

File tree

5 files changed

+49
-39
lines changed

5 files changed

+49
-39
lines changed

name-service/program/src/entrypoint.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
use crate::error::NameServiceError;
2-
use crate::processor::Processor;
3-
use num_traits::FromPrimitive;
4-
use solana_program::{
5-
account_info::AccountInfo, decode_error::DecodeError, entrypoint, entrypoint::ProgramResult,
6-
msg, program_error::PrintProgramError, pubkey::Pubkey,
1+
use {
2+
crate::error::NameServiceError,
3+
crate::processor::Processor,
4+
num_traits::FromPrimitive,
5+
solana_program::{
6+
account_info::AccountInfo, decode_error::DecodeError, entrypoint,
7+
entrypoint::ProgramResult, msg, program_error::PrintProgramError, pubkey::Pubkey,
8+
},
79
};
810

911
entrypoint!(process_instruction);

name-service/program/src/error.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
use num_derive::FromPrimitive;
2-
use solana_program::{decode_error::DecodeError, program_error::ProgramError};
3-
use thiserror::Error;
1+
use {
2+
num_derive::FromPrimitive,
3+
solana_program::{decode_error::DecodeError, program_error::ProgramError},
4+
thiserror::Error,
5+
};
46

57
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
68
pub enum NameServiceError {
7-
#[error("Out of space.")]
9+
#[error("Out of space")]
810
OutOfSpace,
911
}
1012

name-service/program/src/instruction.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
use borsh::{BorshDeserialize, BorshSerialize};
2-
use solana_program::{
3-
instruction::{AccountMeta, Instruction},
4-
program_error::ProgramError,
5-
pubkey::Pubkey,
6-
system_program,
1+
use {
2+
borsh::{BorshDeserialize, BorshSerialize},
3+
solana_program::{
4+
instruction::{AccountMeta, Instruction},
5+
program_error::ProgramError,
6+
pubkey::Pubkey,
7+
system_program,
8+
},
79
};
810

911
/// Instructions supported by the generic Name Registry program
@@ -26,7 +28,7 @@ pub enum NameRegistryInstruction {
2628
/// 3. `[]` Account owner (written into `NameRecordHeader::owner`)
2729
/// 4. `[signer]` Account class (written into `NameRecordHeader::class`).
2830
/// If `Pubkey::default()` then the `signer` bit is not required
29-
/// 5. `[]` Parent name record (written into `NameRecordHeader::parent_name). `Pubkey::default()` is equivalent to no existing parent.
31+
/// 5. `[]` Parent name record (written into `NameRecordHeader::parent_name). `Pubkey::default()` is equivalent to no existing parent.
3032
/// 6. `[signer]` Owner of the parent name record. Optional but needed if parent name different than default.
3133
///
3234
Create {

name-service/program/src/processor.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
use crate::{
2-
instruction::NameRegistryInstruction,
3-
state::get_seeds_and_key,
4-
state::{write_data, NameRecordHeader},
5-
};
6-
use borsh::BorshDeserialize;
7-
use solana_program::{
8-
account_info::{next_account_info, AccountInfo},
9-
entrypoint::ProgramResult,
10-
msg,
11-
program::{invoke, invoke_signed},
12-
program_error::ProgramError,
13-
program_pack::Pack,
14-
pubkey::Pubkey,
15-
system_instruction,
1+
use {
2+
crate::{
3+
instruction::NameRegistryInstruction,
4+
state::get_seeds_and_key,
5+
state::{write_data, NameRecordHeader},
6+
},
7+
borsh::BorshDeserialize,
8+
solana_program::{
9+
account_info::{next_account_info, AccountInfo},
10+
entrypoint::ProgramResult,
11+
msg,
12+
program::{invoke, invoke_signed},
13+
program_error::ProgramError,
14+
program_pack::Pack,
15+
pubkey::Pubkey,
16+
system_instruction,
17+
},
1618
};
1719

1820
pub struct Processor {}

name-service/program/src/state.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
use borsh::{BorshDeserialize, BorshSerialize};
2-
use solana_program::{
3-
account_info::AccountInfo,
4-
msg,
5-
program_error::ProgramError,
6-
program_pack::{IsInitialized, Pack, Sealed},
7-
pubkey::Pubkey,
1+
use {
2+
borsh::{BorshDeserialize, BorshSerialize},
3+
solana_program::{
4+
account_info::AccountInfo,
5+
msg,
6+
program_error::ProgramError,
7+
program_pack::{IsInitialized, Pack, Sealed},
8+
pubkey::Pubkey,
9+
},
810
};
911

1012
/// The data for a Name Registry account is always prefixed a `NameRecordHeader` structure.

0 commit comments

Comments
 (0)