Skip to content

Commit

Permalink
Fix Clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk20 committed Aug 13, 2024
1 parent 1eed1d7 commit 79fd1aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions utils/global-state-update-gen/src/generic/state_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,31 +329,29 @@ impl<T: StateReader> StateTracker<T> {
fn get_withdraws(&mut self) -> WithdrawPurses {
let mut result = self.reader.get_withdraws();
for (acc, purses) in &self.withdraws_cache {
result.insert(acc.clone(), purses.clone());
result.insert(acc, purses.clone());
}
result
}

fn get_unbonds(&mut self) -> UnbondingPurses {
let mut result = self.reader.get_unbonds();
for (acc, purses) in &self.unbonds_cache {
result.insert(acc.clone(), purses.clone());
result.insert(acc, purses.clone());
}
result
}

fn write_withdraw(&mut self, account_hash: AccountHash, withdraws: Vec<WithdrawPurse>) {
self.withdraws_cache
.insert(account_hash.clone(), withdraws.clone());
self.withdraws_cache.insert(account_hash, withdraws.clone());
self.write_entry(
Key::Withdraw(account_hash),
StoredValue::Withdraw(withdraws),
);
}

fn write_unbond(&mut self, account_hash: AccountHash, unbonds: Vec<UnbondingPurse>) {
self.unbonds_cache
.insert(account_hash.clone(), unbonds.clone());
self.unbonds_cache.insert(account_hash, unbonds.clone());
self.write_entry(Key::Unbond(account_hash), StoredValue::Unbonding(unbonds));
}

Expand Down

0 comments on commit 79fd1aa

Please sign in to comment.