Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sambley committed May 31, 2019
1 parent e8c6efb commit ed97e43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
9 changes: 3 additions & 6 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,19 @@ dataDir=$PWD/target/"$(basename "$0" .sh)"

set -x
leader_keypair="$dataDir/config/leader-keypair.json"
if [ -e "$leader_keypair" ]
then
if [[ -e "$leader_keypair" ]]; then
echo "Use existing leader keypair"
else
solana-keygen -o "$leader_keypair"
fi
leader_vote_account_keypair="$dataDir/config/leader-vote-account-keypair.json"
if [ -e "$leader_vote_account_keypair" ]
then
if [[ -e "$leader_vote_account_keypair" ]]; then
echo "Use existing leader vote account keypair"
else
solana-keygen -o "$leader_vote_account_keypair"
fi
leader_stake_account_keypair="$dataDir/config/leader-stake-account-keypair.json"
if [ -e "$leader_stake_account_keypair" ]
then
if [[ -e "$leader_stake_account_keypair" ]]; then
echo "Use existing leader stake account keypair"
else
solana-keygen -o "$leader_stake_account_keypair"
Expand Down
14 changes: 9 additions & 5 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl AccountStorageEntry {
}

// This structure handles the load/store of the accounts
#[derive(Default, Debug)]
#[derive(Debug)]
pub struct AccountsDB {
/// Keeps tracks of index into AppendVec on a per fork basis
pub accounts_index: RwLock<AccountsIndex<AccountInfo>>,
Expand Down Expand Up @@ -256,7 +256,7 @@ impl Default for AccountsDB {
fn default() -> Self {
AccountsDB {
accounts_index: RwLock::new(AccountsIndex::default()),
storage: RwLock::new(HashMap::new()),
storage: RwLock::new(AccountStorage(HashMap::new())),
next_id: AtomicUsize::new(0),
write_version: AtomicUsize::new(0),
paths: Vec::default(),
Expand Down Expand Up @@ -331,9 +331,9 @@ impl AccountsDB {
.map(|storage| {
let accounts = storage.accounts.accounts(0);
let mut retval = B::default();
accounts
.iter()
.for_each(|stored_account| scan_func(stored_account, storage.id, &mut retval));
accounts.iter().for_each(|stored_account| {
scan_func(stored_account, storage.id, &mut retval)
});
retval
})
.collect()
Expand Down Expand Up @@ -627,6 +627,10 @@ impl<'a> serde::de::Visitor<'a> for AccountsDBVisitor {
write_version: AtomicUsize::new(write_version as usize),
paths,
file_size,
thread_pool: rayon::ThreadPoolBuilder::new()
.num_threads(2)
.build()
.unwrap(),
};
accounts_db.generate_index();

Expand Down

0 comments on commit ed97e43

Please sign in to comment.