Skip to content

Commit

Permalink
fix: clippy error related to matches!
Browse files Browse the repository at this point in the history
closes #850
  • Loading branch information
tublitzed committed Oct 8, 2020
1 parent 0a175dd commit 06aed80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/db/tests/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ async fn expiry() -> Result<()> {
let bsos = vec![postbso("b0", Some("payload 0"), Some(10), None)];
let result = db.append_to_batch(ab(uid, coll, new_batch, bsos)).await;
let is_batch_not_found = match result.unwrap_err().kind() {
ApiErrorKind::Db(dbe) => match dbe.kind() {
DbErrorKind::BatchNotFound => true,
_ => false,
},
ApiErrorKind::Db(dbe) => matches!(dbe.kind(), DbErrorKind::BatchNotFound),
_ => false,
};
assert!(is_batch_not_found, "Expected BatchNotFound");
Expand Down
5 changes: 1 addition & 4 deletions src/db/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,7 @@ impl FromRequest for DbTransactionPool {
let bso = BsoParam::extrude(req.head(), &mut req.extensions_mut()).ok();
let bso_opt = bso.map(|b| b.bso);

let is_read = match method {
Method::GET | Method::HEAD => true,
_ => false,
};
let is_read = matches!(method, Method::GET | Method::HEAD);
let precondition = PreConditionHeaderOpt::extrude(&req.headers(), Some(tags.clone()))?;
let pool = Self {
pool: state.db_pool.clone(),
Expand Down

0 comments on commit 06aed80

Please sign in to comment.