From 39933cd333134a2d187adccf67f6febccacf5450 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Mon, 22 May 2023 22:53:59 -0400 Subject: [PATCH] clippy::redundant_pattern_matching warning: redundant pattern matching, consider using `is_err()` --> src/race.rs:354:20 | 354 | if let Err(_) = exchange { | -------^^^^^^----------- help: try this: `if exchange.is_err()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching = note: `#[warn(clippy::redundant_pattern_matching)]` on by default --- src/race.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/race.rs b/src/race.rs index ee3d51a..fe36fa1 100644 --- a/src/race.rs +++ b/src/race.rs @@ -351,7 +351,7 @@ mod once_box { Ordering::AcqRel, Ordering::Acquire, ); - if let Err(_) = exchange { + if exchange.is_err() { let value = unsafe { Box::from_raw(ptr) }; return Err(value); }