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,7 +1,6 @@
//! This account contains the clock slot, epoch, and leader_schedule_epoch
//!
pub use crate::clock::Clock;
use crate::{impl_sysvar_get, program_error::ProgramError, sysvar::Sysvar};
crate::declare_sysvar_id!("SysvarC1ock11111111111111111111111111111111", Clock);

View File

@@ -1,7 +1,6 @@
//! This account contains the current cluster rent
//!
pub use crate::epoch_schedule::EpochSchedule;
use crate::{impl_sysvar_get, program_error::ProgramError, sysvar::Sysvar};
crate::declare_sysvar_id!("SysvarEpochSchedu1e111111111111111111111111", EpochSchedule);

View File

@@ -118,9 +118,11 @@ pub fn get_instruction_relative(
#[cfg(test)]
mod tests {
use super::*;
use crate::{instruction::AccountMeta, message::Message, pubkey::Pubkey};
use std::convert::TryFrom;
use {
super::*,
crate::{instruction::AccountMeta, message::Message, pubkey::Pubkey},
std::convert::TryFrom,
};
#[test]
fn test_load_store_instruction() {

View File

@@ -1,7 +1,9 @@
//! named accounts for synthesized data accounts for bank state, etc.
//!
use crate::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey};
use lazy_static::lazy_static;
use {
crate::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey},
lazy_static::lazy_static,
};
pub mod clock;
pub mod epoch_schedule;
@@ -140,9 +142,11 @@ macro_rules! impl_sysvar_get {
#[cfg(test)]
mod tests {
use super::*;
use crate::{clock::Epoch, program_error::ProgramError, pubkey::Pubkey};
use std::{cell::RefCell, rc::Rc};
use {
super::*,
crate::{clock::Epoch, program_error::ProgramError, pubkey::Pubkey},
std::{cell::RefCell, rc::Rc},
};
#[repr(C)]
#[derive(Serialize, Deserialize, Debug, Default, PartialEq)]

View File

@@ -1,12 +1,14 @@
#![allow(deprecated)]
#![allow(clippy::integer_arithmetic)]
use crate::{
declare_deprecated_sysvar_id,
fee_calculator::FeeCalculator,
hash::{hash, Hash},
sysvar::Sysvar,
use {
crate::{
declare_deprecated_sysvar_id,
fee_calculator::FeeCalculator,
hash::{hash, Hash},
sysvar::Sysvar,
},
std::{cmp::Ordering, collections::BinaryHeap, iter::FromIterator, ops::Deref},
};
use std::{cmp::Ordering, collections::BinaryHeap, iter::FromIterator, ops::Deref};
#[deprecated(
since = "1.9.0",
@@ -161,8 +163,7 @@ pub fn create_test_recent_blockhashes(start: usize) -> RecentBlockhashes {
#[cfg(test)]
mod tests {
use super::*;
use crate::clock::MAX_PROCESSING_AGE;
use {super::*, crate::clock::MAX_PROCESSING_AGE};
#[test]
#[allow(clippy::assertions_on_constants)]

View File

@@ -1,7 +1,6 @@
//! This account contains the current cluster rent
//!
pub use crate::rent::Rent;
use crate::{impl_sysvar_get, program_error::ProgramError, sysvar::Sysvar};
crate::declare_sysvar_id!("SysvarRent111111111111111111111111111111111", Rent);

View File

@@ -3,7 +3,6 @@
//! this account carries the Bank's most recent bank hashes for some N parents
//!
pub use crate::slot_hashes::SlotHashes;
use crate::{account_info::AccountInfo, program_error::ProgramError, sysvar::Sysvar};
crate::declare_sysvar_id!("SysvarS1otHashes111111111111111111111111111", SlotHashes);
@@ -22,8 +21,10 @@ impl Sysvar for SlotHashes {
#[cfg(test)]
mod tests {
use super::*;
use crate::{clock::Slot, hash::Hash, slot_hashes::MAX_ENTRIES};
use {
super::*,
crate::{clock::Slot, hash::Hash, slot_hashes::MAX_ENTRIES},
};
#[test]
fn test_size_of() {

View File

@@ -3,12 +3,11 @@
//! this account carries a bitvector of slots present over the past
//! epoch
//!
use crate::sysvar::Sysvar;
pub use crate::{
account_info::AccountInfo, program_error::ProgramError, slot_history::SlotHistory,
};
use crate::sysvar::Sysvar;
crate::declare_sysvar_id!("SysvarS1otHistory11111111111111111111111111", SlotHistory);
impl Sysvar for SlotHistory {

View File

@@ -3,7 +3,6 @@
//! this account carries history about stake activations and de-activations
//!
pub use crate::stake_history::StakeHistory;
use crate::sysvar::Sysvar;
crate::declare_sysvar_id!("SysvarStakeHistory1111111111111111111111111", StakeHistory);
@@ -18,8 +17,7 @@ impl Sysvar for StakeHistory {
#[cfg(test)]
mod tests {
use super::*;
use crate::stake_history::*;
use {super::*, crate::stake_history::*};
#[test]
fn test_size_of() {