Skip to content

Commit

Permalink
Ignore char_lit_as_u8 clippy lint in test
Browse files Browse the repository at this point in the history
    warning: casting a character literal to `u8` truncates
       --> tests/test_ensure.rs:495:30
        |
    495 |     let test = || Ok(ensure!('\0' as u8 > 1));
        |                              ^^^^^^^^^^ help: use a byte literal instead: `b'\0'`
        |
        = note: `char` is four bytes wide, but `u8` is a single byte
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
        = note: `#[warn(clippy::char_lit_as_u8)]` on by default

    warning: casting a character literal to `u8` truncates
       --> tests/test_ensure.rs:498:30
        |
    498 |     let test = || Ok(ensure!('\0' as ::std::primitive::u8 > 1));
        |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a byte literal instead: `b'\0'`
        |
        = note: `char` is four bytes wide, but `u8` is a single byte
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
  • Loading branch information
dtolnay committed May 17, 2024
1 parent 368f3e9 commit d1742a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_ensure.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(
clippy::bool_to_int_with_if,
clippy::char_lit_as_u8,
clippy::diverging_sub_expression,
clippy::extra_unused_type_parameters,
clippy::if_same_then_else,
Expand Down

0 comments on commit d1742a8

Please sign in to comment.