Add rustfmt.toml and cargo fmt (#23238)

* fmt

* formatted

Co-authored-by: Lucas B <buffalu@jito.network>
This commit is contained in:
buffalu
2022-02-18 23:32:29 -06:00
committed by GitHub
parent 1add82aa9e
commit 70ebab2c82
33 changed files with 127 additions and 108 deletions

View File

@@ -245,8 +245,7 @@ pub struct SquashTiming {
type EpochCount = u64;
mod executor_cache {
use super::*;
use log;
use {super::*, log};
#[derive(Debug, Default)]
pub struct Stats {
@@ -16162,8 +16161,10 @@ pub(crate) mod tests {
/// Test exceeding the accounts data budget by creating accounts in a loop
#[test]
fn test_accounts_data_budget_exceeded() {
use solana_program_runtime::accounts_data_meter::MAX_ACCOUNTS_DATA_LEN;
use solana_sdk::system_instruction::MAX_PERMITTED_DATA_LENGTH;
use {
solana_program_runtime::accounts_data_meter::MAX_ACCOUNTS_DATA_LEN,
solana_sdk::system_instruction::MAX_PERMITTED_DATA_LENGTH,
};
solana_logger::setup();
let (genesis_config, mint_keypair) = create_genesis_config(1_000_000_000_000);

View File

@@ -3,8 +3,7 @@ use {
log::*,
solana_measure::measure::Measure,
solana_sdk::clock::Slot,
std::ops::Range,
std::ops::{Bound, RangeBounds},
std::ops::{Bound, Range, RangeBounds},
};
/// Provide access to SnapshotStorages sorted by slot

View File

@@ -27,8 +27,7 @@ type StakeHistoryInner = solana_sdk::stake_history::StakeHistory;
#[cfg(test)]
mod tests {
use super::*;
use solana_sdk::stake_history::StakeHistoryEntry;
use {super::*, solana_sdk::stake_history::StakeHistoryEntry};
fn rand_stake_history_entry() -> StakeHistoryEntry {
StakeHistoryEntry {

View File

@@ -88,13 +88,17 @@ fn parse_vote_instruction_data(
#[cfg(test)]
mod test {
use solana_sdk::signature::{Keypair, Signer};
use solana_vote_program::{
vote_instruction, vote_state::Vote, vote_transaction::new_vote_transaction,
use {
super::*,
solana_sdk::{
hash::hash,
signature::{Keypair, Signer},
},
solana_vote_program::{
vote_instruction, vote_state::Vote, vote_transaction::new_vote_transaction,
},
};
use {super::*, solana_sdk::hash::hash};
fn run_test_parse_vote_transaction(input_hash: Option<Hash>) {
let node_keypair = Keypair::new();
let vote_keypair = Keypair::new();