diff --git a/name-service/program/src/entrypoint.rs b/name-service/program/src/entrypoint.rs index cdf257535eb..1e70cd1ce17 100644 --- a/name-service/program/src/entrypoint.rs +++ b/name-service/program/src/entrypoint.rs @@ -1,9 +1,11 @@ -use crate::error::NameServiceError; -use crate::processor::Processor; -use num_traits::FromPrimitive; -use solana_program::{ - account_info::AccountInfo, decode_error::DecodeError, entrypoint, entrypoint::ProgramResult, - msg, program_error::PrintProgramError, pubkey::Pubkey, +use { + crate::error::NameServiceError, + crate::processor::Processor, + num_traits::FromPrimitive, + solana_program::{ + account_info::AccountInfo, decode_error::DecodeError, entrypoint, + entrypoint::ProgramResult, msg, program_error::PrintProgramError, pubkey::Pubkey, + }, }; entrypoint!(process_instruction); diff --git a/name-service/program/src/error.rs b/name-service/program/src/error.rs index f74690f1567..4da3075b24f 100644 --- a/name-service/program/src/error.rs +++ b/name-service/program/src/error.rs @@ -1,10 +1,12 @@ -use num_derive::FromPrimitive; -use solana_program::{decode_error::DecodeError, program_error::ProgramError}; -use thiserror::Error; +use { + num_derive::FromPrimitive, + solana_program::{decode_error::DecodeError, program_error::ProgramError}, + thiserror::Error, +}; #[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)] pub enum NameServiceError { - #[error("Out of space.")] + #[error("Out of space")] OutOfSpace, } diff --git a/name-service/program/src/instruction.rs b/name-service/program/src/instruction.rs index 8fac9546db7..be830f44dd0 100644 --- a/name-service/program/src/instruction.rs +++ b/name-service/program/src/instruction.rs @@ -1,9 +1,11 @@ -use borsh::{BorshDeserialize, BorshSerialize}; -use solana_program::{ - instruction::{AccountMeta, Instruction}, - program_error::ProgramError, - pubkey::Pubkey, - system_program, +use { + borsh::{BorshDeserialize, BorshSerialize}, + solana_program::{ + instruction::{AccountMeta, Instruction}, + program_error::ProgramError, + pubkey::Pubkey, + system_program, + }, }; /// Instructions supported by the generic Name Registry program @@ -26,7 +28,7 @@ pub enum NameRegistryInstruction { /// 3. `[]` Account owner (written into `NameRecordHeader::owner`) /// 4. `[signer]` Account class (written into `NameRecordHeader::class`). /// If `Pubkey::default()` then the `signer` bit is not required - /// 5. `[]` Parent name record (written into `NameRecordHeader::parent_name). `Pubkey::default()` is equivalent to no existing parent. + /// 5. `[]` Parent name record (written into `NameRecordHeader::parent_name). `Pubkey::default()` is equivalent to no existing parent. /// 6. `[signer]` Owner of the parent name record. Optional but needed if parent name different than default. /// Create { diff --git a/name-service/program/src/processor.rs b/name-service/program/src/processor.rs index 2990196d750..7324a23684c 100644 --- a/name-service/program/src/processor.rs +++ b/name-service/program/src/processor.rs @@ -1,18 +1,20 @@ -use crate::{ - instruction::NameRegistryInstruction, - state::get_seeds_and_key, - state::{write_data, NameRecordHeader}, -}; -use borsh::BorshDeserialize; -use solana_program::{ - account_info::{next_account_info, AccountInfo}, - entrypoint::ProgramResult, - msg, - program::{invoke, invoke_signed}, - program_error::ProgramError, - program_pack::Pack, - pubkey::Pubkey, - system_instruction, +use { + crate::{ + instruction::NameRegistryInstruction, + state::get_seeds_and_key, + state::{write_data, NameRecordHeader}, + }, + borsh::BorshDeserialize, + solana_program::{ + account_info::{next_account_info, AccountInfo}, + entrypoint::ProgramResult, + msg, + program::{invoke, invoke_signed}, + program_error::ProgramError, + program_pack::Pack, + pubkey::Pubkey, + system_instruction, + }, }; pub struct Processor {} diff --git a/name-service/program/src/state.rs b/name-service/program/src/state.rs index 95241f70fce..6a07a40e028 100644 --- a/name-service/program/src/state.rs +++ b/name-service/program/src/state.rs @@ -1,10 +1,12 @@ -use borsh::{BorshDeserialize, BorshSerialize}; -use solana_program::{ - account_info::AccountInfo, - msg, - program_error::ProgramError, - program_pack::{IsInitialized, Pack, Sealed}, - pubkey::Pubkey, +use { + borsh::{BorshDeserialize, BorshSerialize}, + solana_program::{ + account_info::AccountInfo, + msg, + program_error::ProgramError, + program_pack::{IsInitialized, Pack, Sealed}, + pubkey::Pubkey, + }, }; /// The data for a Name Registry account is always prefixed a `NameRecordHeader` structure.