Skip to content

Commit

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

let inserts = ops
.iter()
.filter_map(|current_op| match current_op.op {
Op::Insert { .. } | Op::Replace { .. } => Some(current_op),
_ => None,
.filter(|current_op| match current_op.op {
Op::Insert { .. } | Op::Replace { .. } => true,
_ => false,
})

Check warning on line 595 in grovedb/src/batch/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

match expression looks like `matches!` macro

warning: match expression looks like `matches!` macro --> grovedb/src/batch/mod.rs:592:34 | 592 | .filter(|current_op| match current_op.op { | __________________________________^ 593 | | Op::Insert { .. } | Op::Replace { .. } => true, 594 | | _ => false, 595 | | }) | |_____________^ help: try: `matches!(current_op.op, Op::Insert { .. } | Op::Replace { .. })` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
.collect::<Vec<&GroveDbOp>>();

let deletes = ops
.iter()
.filter_map(|current_op| {
.filter(|current_op| {
if let Op::Delete = current_op.op {
Some(current_op)
true
} else {
None
false
}

Check warning on line 605 in grovedb/src/batch/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

if let .. else expression looks like `matches!` macro

warning: if let .. else expression looks like `matches!` macro --> grovedb/src/batch/mod.rs:601:17 | 601 | / if let Op::Delete = current_op.op { 602 | | true 603 | | } else { 604 | | false 605 | | } | |_________________^ help: try: `matches!(current_op.op, Op::Delete)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
})
.collect::<Vec<&GroveDbOp>>();
Expand Down

0 comments on commit d998701

Please sign in to comment.