Skip to content

Commit

Permalink
Ignore irrefutable_let_patterns lint in test suite
Browse files Browse the repository at this point in the history
    warning: irrefutable `if let` pattern
       --> tests/test_ensure.rs:656:30
        |
    656 |     let test = || Ok(ensure!(if let P::<u8> {} = p { 0 } else { 1 } == 1));
        |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(irrefutable_let_patterns)]` on by default
        = note: this pattern will always match, so the `if let` is useless
        = help: consider replacing the `if let` with a `let`

    warning: irrefutable `if let` pattern
       --> tests/test_ensure.rs:662:30
        |
    662 |     let test = || Ok(ensure!(if let ::std::marker::PhantomData = p {} != ()));
        |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: this pattern will always match, so the `if let` is useless
        = help: consider replacing the `if let` with a `let`
  • Loading branch information
dtolnay committed Jan 1, 2022
1 parent bae6962 commit 2342773
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_ensure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
clippy::too_many_lines,
clippy::unit_arg,
clippy::while_immutable_condition,
clippy::zero_ptr
clippy::zero_ptr,
irrefutable_let_patterns
)]

use anyhow::{anyhow, ensure, Chain, Error, Result};
Expand Down

0 comments on commit 2342773

Please sign in to comment.