Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shaorongqiang committed Mar 5, 2024
1 parent fc921ee commit fd4c9c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/ledger/src/data_model/effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl TxnEffect {

// (1), within this transaction
//let v = vec![];
let iss_nums = self.new_issuance_nums.entry(code).or_insert_with(Vec::new);
let iss_nums = self.new_issuance_nums.entry(code).or_default();

if let Some(last_num) = iss_nums.last() {
if seq_num <= *last_num {
Expand Down Expand Up @@ -663,7 +663,7 @@ impl BlockEffect {
if self.staking_simulator.cur_height > CFG.checkpoint.fix_check_replay
&& txn_effect.txn.body.operations.len() == 1
{
if let Some(Operation::MintFra(_)) = txn_effect.txn.body.operations.get(0) {
if let Some(Operation::MintFra(_)) = txn_effect.txn.body.operations.first() {
flag = false;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/ledger/src/staking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ impl Staking {
self.delegation_info
.end_height_map
.entry(end_height)
.or_insert_with(BTreeSet::new)
.or_default()
.insert(owner);

// There should be no failure here !!
Expand Down Expand Up @@ -903,7 +903,7 @@ impl Staking {
self.delegation_info
.end_height_map
.entry(h + CFG.checkpoint.unbond_block_cnt)
.or_insert_with(BTreeSet::new)
.or_default()
.insert(*addr);
}

Expand Down Expand Up @@ -995,7 +995,7 @@ impl Staking {
self.delegation_info
.end_height_map
.entry(h + CFG.checkpoint.unbond_block_cnt)
.or_insert_with(BTreeSet::new)
.or_default()
.insert(pu.new_delegator_id);

// update delegator entries for pu target_validator
Expand Down Expand Up @@ -1078,7 +1078,7 @@ impl Staking {
self.delegation_info
.end_height_map
.entry(end_height)
.or_insert_with(BTreeSet::new)
.or_default()
.insert(addr.to_owned());
Ok(())
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/ledger/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,11 @@ impl LedgerState {
let utxo_map_path = format!("{}/{}utxo_map", basedir, &prefix);

// These iterms will be set under ${BNC_DATA_DIR}
fs::create_dir_all(&basedir).c(d!())?;
fs::create_dir_all(basedir).c(d!())?;
let snapshot_file = format!("{}ledger_status", &prefix);

let snapshot_entries_dir = prefix.clone() + "ledger_status_subdata";
env::set_var(LSSED_VAR, &snapshot_entries_dir);
env::set_var(LSSED_VAR, snapshot_entries_dir);

let blocks_path = prefix.clone() + "blocks";
let tx_to_block_location_path = prefix.clone() + "tx_to_block_location";
Expand Down Expand Up @@ -801,7 +801,7 @@ impl LedgerState {

let res = sids
.into_iter()
.zip(aus.into_iter())
.zip(aus)
.filter_map(|(sid, au)| au.map(|au| (sid, au)))
.map(|(sid, au)| {
(
Expand Down

0 comments on commit fd4c9c4

Please sign in to comment.