Ignore bool_to_int_with_if clippy lint

error: boolean to int conversion using if
       --> src/reader.rs:301:28
        |
    301 |                       high = if (*parser).encoding == YAML_UTF16LE_ENCODING {
        |  ____________________________^
    302 | |                         1
    303 | |                     } else {
    304 | |                         0
    305 | |                     };
        | |_____________________^ help: replace with from: `i32::from((*parser).encoding == YAML_UTF16LE_ENCODING)`
        |
        = note: `-D clippy::bool-to-int-with-if` implied by `-D clippy::all`
        = note: `((*parser).encoding == YAML_UTF16LE_ENCODING) as i32` or `((*parser).encoding == YAML_UTF16LE_ENCODING).into()` can also be valid options
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if

    error: boolean to int conversion using if
      --> src/writer.rs:58:29
       |
    58 |       let high: libc::c_int = if (*emitter).encoding == YAML_UTF16LE_ENCODING {
       |  _____________________________^
    59 | |         1
    60 | |     } else {
    61 | |         0
    62 | |     };
       | |_____^ help: replace with from: `i32::from((*emitter).encoding == YAML_UTF16LE_ENCODING)`
       |
       = note: `((*emitter).encoding == YAML_UTF16LE_ENCODING) as i32` or `((*emitter).encoding == YAML_UTF16LE_ENCODING).into()` can also be valid options
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if
This commit is contained in:
David Tolnay 2022-09-10 20:16:48 -07:00
parent 97bc12eaa1
commit f8756063ff
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -9,6 +9,7 @@
#![allow(non_camel_case_types, non_snake_case)]
#![warn(clippy::pedantic)]
#![allow(
clippy::bool_to_int_with_if,
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,