Skip to content

Commit

Permalink
chore: use matches!
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Mar 22, 2024
1 parent d998701 commit 3ece070
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions grovedb/src/batch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,21 +589,12 @@ impl GroveDbOp {

let inserts = ops
.iter()
.filter(|current_op| match current_op.op {
Op::Insert { .. } | Op::Replace { .. } => true,
_ => false,
})
.filter(|current_op| matches!(current_op.op, Op::Insert { .. } | Op::Replace { .. }))
.collect::<Vec<&GroveDbOp>>();

let deletes = ops
.iter()
.filter(|current_op| {
if let Op::Delete = current_op.op {
true
} else {
false
}
})
.filter(|current_op| matches!(current_op.op, Op::Delete))
.collect::<Vec<&GroveDbOp>>();

let insert_ops_below_deleted_ops = deletes
Expand Down

0 comments on commit 3ece070

Please sign in to comment.