Skip to content

Commit

Permalink
refactor: an exact Option combinator
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed May 18, 2022
1 parent 915d616 commit c7abbe1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions sui_storage/src/lock_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,7 @@ impl LockServiceImpl {
let existing_locks: Vec<ObjectRef> = locks
.iter()
.zip(objects)
.filter_map(|(lock_opt, objref)| {
if let Some(Some(_tx_digest)) = lock_opt {
Some(*objref)
} else {
None
}
})
.filter_map(|(lock_opt, objref)| lock_opt.flatten().map(|_tx_digest| *objref))
.collect();
if !existing_locks.is_empty() {
info!(
Expand Down

0 comments on commit c7abbe1

Please sign in to comment.