Clippy: redundant pattern matching, consider using is_err

This commit is contained in:
Graham Christensen 2019-01-02 17:44:29 -05:00
parent 48d2815c1a
commit a9e2c02c8c
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
3 changed files with 3 additions and 3 deletions

View file

@ -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");

View file

@ -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;

View file

@ -262,7 +262,7 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for MassRebuildWorker<E
overall_status.set_with_description("Merging PR", hubcaps::statuses::State::Pending);
if let Err(_) = co.merge_commit(job.pr.head_sha.as_ref()) {
if co.merge_commit(job.pr.head_sha.as_ref()).is_err() {
overall_status.set_with_description(
"Failed to merge",
hubcaps::statuses::State::Failure,