Skip to content

Commit

Permalink
clippy::redundant_pattern_matching
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jqnatividad committed May 23, 2023
1 parent 307ff0c commit 39933cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 39933cd

Please sign in to comment.