Skip to content

Commit

Permalink
chore: clippy kv_store
Browse files Browse the repository at this point in the history
  • Loading branch information
bsbds committed May 16, 2024
1 parent 811d7dd commit d99bb7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
9 changes: 4 additions & 5 deletions crates/xline/src/storage/kv_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ impl KvStore {
// As we store use revision as key in the DB storage,
// a fake revision needs to be used during speculative execution
let fake_revision = i64::MAX;
self.execute_txn(&txn_db, index, req, fake_revision, &mut 0)
self.execute_txn(txn_db, index, req, fake_revision, &mut 0)
.map(Into::into)?
}
RequestWrapper::CompactionRequest(ref req) => {
Expand Down Expand Up @@ -720,7 +720,7 @@ impl KvStore {
fn execute_txn_put(
&self,
txn_db: &Transaction,
index: &mut dyn IndexOperate,
index: &dyn IndexOperate,
req: &PutRequest,
revision: i64,
sub_revision: &mut i64,
Expand Down Expand Up @@ -801,7 +801,7 @@ impl KvStore {
fn execute_txn_delete_range<T>(
&self,
txn_db: &T,
index: &mut dyn IndexOperate,
index: &dyn IndexOperate,
req: &DeleteRangeRequest,
revision: i64,
sub_revision: &mut i64,
Expand Down Expand Up @@ -1109,8 +1109,7 @@ impl KvStore {
succeeded: success,
responses: resps
.into_iter()
.map(Option::into_iter)
.flatten()
.flat_map(Option::into_iter)
.map(Into::into)
.collect(),
}
Expand Down
12 changes: 3 additions & 9 deletions crates/xline/src/storage/lease_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,11 @@ impl LeaseStore {
}

let txn_db = self.db.transaction();
let mut txn_index = self.index.state();
let txn_index = self.index.state();

for (key, mut sub_revision) in del_keys.iter().zip(0..) {
let deleted = KvStore::delete_keys(
&txn_db,
&mut txn_index,
key,
&[],
revision,
&mut sub_revision,
)?;
let deleted =
KvStore::delete_keys(&txn_db, &txn_index, key, &[], revision, &mut sub_revision)?;
KvStore::detach_leases(&deleted, &self.lease_collection);
let mut del_event = KvStore::new_deletion_events(revision, deleted);
updates.append(&mut del_event);
Expand Down

0 comments on commit d99bb7e

Please sign in to comment.