Reformat imports to a consistent style for imports

rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
This commit is contained in:
Michael Vines
2021-12-03 09:00:31 -08:00
parent 0ef1b25e4b
commit b8837c04ec
397 changed files with 5990 additions and 5175 deletions

View File

@@ -1,16 +1,17 @@
use crate::args::{
Args, AuthorizeArgs, Command, CountArgs, MoveArgs, NewArgs, QueryArgs, RebaseArgs,
SetLockupArgs,
use {
crate::args::{
Args, AuthorizeArgs, Command, CountArgs, MoveArgs, NewArgs, QueryArgs, RebaseArgs,
SetLockupArgs,
},
clap::{value_t, value_t_or_exit, App, Arg, ArgMatches, SubCommand},
solana_clap_utils::{
input_parsers::unix_timestamp_from_rfc3339_datetime,
input_validators::{is_amount, is_rfc3339_datetime, is_valid_pubkey, is_valid_signer},
},
solana_cli_config::CONFIG_FILE,
solana_sdk::native_token::sol_to_lamports,
std::{ffi::OsString, process::exit},
};
use clap::{value_t, value_t_or_exit, App, Arg, ArgMatches, SubCommand};
use solana_clap_utils::{
input_parsers::unix_timestamp_from_rfc3339_datetime,
input_validators::{is_amount, is_rfc3339_datetime, is_valid_pubkey, is_valid_signer},
};
use solana_cli_config::CONFIG_FILE;
use solana_sdk::native_token::sol_to_lamports;
use std::ffi::OsString;
use std::process::exit;
fn fee_payer_arg<'a, 'b>() -> Arg<'a, 'b> {
solana_clap_utils::fee_payer::fee_payer_arg().required(true)

View File

@@ -1,13 +1,14 @@
use clap::ArgMatches;
use solana_clap_utils::keypair::{pubkey_from_path, signer_from_path};
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
use solana_sdk::{
clock::{Epoch, UnixTimestamp},
pubkey::Pubkey,
signature::Signer,
use {
clap::ArgMatches,
solana_clap_utils::keypair::{pubkey_from_path, signer_from_path},
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_sdk::{
clock::{Epoch, UnixTimestamp},
pubkey::Pubkey,
signature::Signer,
},
std::{error::Error, sync::Arc},
};
use std::error::Error;
use std::sync::Arc;
pub(crate) struct NewArgs<P, K> {
pub fee_payer: K,

View File

@@ -3,25 +3,27 @@ mod arg_parser;
mod args;
mod stake_accounts;
use crate::arg_parser::parse_args;
use crate::args::{
resolve_command, AuthorizeArgs, Command, MoveArgs, NewArgs, RebaseArgs, SetLockupArgs,
use {
crate::{
arg_parser::parse_args,
args::{
resolve_command, AuthorizeArgs, Command, MoveArgs, NewArgs, RebaseArgs, SetLockupArgs,
},
},
solana_cli_config::Config,
solana_client::{client_error::ClientError, rpc_client::RpcClient},
solana_sdk::{
message::Message,
native_token::lamports_to_sol,
pubkey::Pubkey,
signature::{unique_signers, Signature, Signer},
signers::Signers,
stake::{instruction::LockupArgs, state::Lockup},
transaction::Transaction,
},
solana_stake_program::stake_state,
std::{env, error::Error},
};
use solana_cli_config::Config;
use solana_client::client_error::ClientError;
use solana_client::rpc_client::RpcClient;
use solana_sdk::{
message::Message,
native_token::lamports_to_sol,
pubkey::Pubkey,
signature::{unique_signers, Signature, Signer},
signers::Signers,
stake::{instruction::LockupArgs, state::Lockup},
transaction::Transaction,
};
use solana_stake_program::stake_state;
use std::env;
use std::error::Error;
fn get_balance_at(client: &RpcClient, pubkey: &Pubkey, i: usize) -> Result<u64, ClientError> {
let address = stake_accounts::derive_stake_account_address(pubkey, i);

View File

@@ -281,16 +281,18 @@ pub(crate) fn move_stake_accounts(
#[cfg(test)]
mod tests {
use super::*;
use solana_runtime::{bank::Bank, bank_client::BankClient};
use solana_sdk::{
account::{AccountSharedData, ReadableAccount},
client::SyncClient,
genesis_config::create_genesis_config,
signature::{Keypair, Signer},
stake::state::StakeState,
use {
super::*,
solana_runtime::{bank::Bank, bank_client::BankClient},
solana_sdk::{
account::{AccountSharedData, ReadableAccount},
client::SyncClient,
genesis_config::create_genesis_config,
signature::{Keypair, Signer},
stake::state::StakeState,
},
solana_stake_program::stake_state,
};
use solana_stake_program::stake_state;
fn create_bank(lamports: u64) -> (Bank, Keypair, u64) {
let (genesis_config, mint_keypair) = create_genesis_config(lamports);