From a9e2c02c8ce01e8917cc1d8bbb1422f130ded8b6 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 2 Jan 2019 17:44:29 -0500 Subject: [PATCH] Clippy: redundant pattern matching, consider using is_err --- ofborg/src/lib.rs | 2 +- ofborg/src/tasks/build.rs | 2 +- ofborg/src/tasks/massrebuilder.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ofborg/src/lib.rs b/ofborg/src/lib.rs index 4ea56f3..e085563 100644 --- a/ofborg/src/lib.rs +++ b/ofborg/src/lib.rs @@ -92,7 +92,7 @@ pub mod ofborg { } pub fn setup_log() { - if let Err(_) = env::var("RUST_LOG") { + if env::var("RUST_LOG").is_err() { env::set_var("RUST_LOG", "info"); env_logger::init().unwrap(); info!("Defaulting RUST_LOG environment variable to info"); diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index a18f7e1..1f19518 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -333,7 +333,7 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { return; } - if let Err(_) = co.merge_commit(job.pr.head_sha.as_ref()) { + if co.merge_commit(job.pr.head_sha.as_ref()).is_err() { info!("Failed to merge {}", job.pr.head_sha); actions.merge_failed(); return; diff --git a/ofborg/src/tasks/massrebuilder.rs b/ofborg/src/tasks/massrebuilder.rs index 1295b01..412b600 100644 --- a/ofborg/src/tasks/massrebuilder.rs +++ b/ofborg/src/tasks/massrebuilder.rs @@ -262,7 +262,7 @@ impl worker::SimpleWorker for MassRebuildWorker