Skip to content

Commit

Permalink
Ignore assertions_on_result_states clippy lint
Browse files Browse the repository at this point in the history
    error: called `assert!` with `Result::is_err`
      --> tests/regression/issue795.rs:53:5
       |
    53 |     assert!(serde_json::from_str::<Enum>(s).is_err());
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `serde_json::from_str::<Enum>(s).unwrap_err()`
       |
       = note: `-D clippy::assertions-on-result-states` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
      --> tests/regression/issue795.rs:56:5
       |
    56 |     assert!(serde_json::from_value::<Enum>(j).is_err());
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `serde_json::from_value::<Enum>(j).unwrap_err()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/stream.rs:179:9
        |
    179 |         assert!(stream.next().unwrap().is_err());
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stream.next().unwrap().unwrap_err()`
        |
        = note: `-D clippy::assertions-on-result-states` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
       --> tests/test.rs:940:5
        |
    940 |     assert!(v.is_err());
        |     ^^^^^^^^^^^^^^^^^^^ help: replace with: `v.unwrap_err()`
        |
        = note: `-D clippy::assertions-on-result-states` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
        --> tests/test.rs:1735:5
         |
    1735 |     assert!(res.is_err());
         |     ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `res.unwrap_err()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
        --> tests/test.rs:1738:5
         |
    1738 |     assert!(res.is_err());
         |     ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `res.unwrap_err()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
        --> tests/test.rs:1741:5
         |
    1741 |     assert!(res.is_err());
         |     ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `res.unwrap_err()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
        --> tests/test.rs:1930:5
         |
    1930 |     assert!(serde_json::to_value(&map).is_err());
         |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `serde_json::to_value(&map).unwrap_err()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states

    error: called `assert!` with `Result::is_err`
        --> tests/test.rs:2005:5
         |
    2005 |     assert!(from_str::<E>(r#" "V"0 "#).is_err());
         |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `from_str::<E>(r#" "V"0 "#).unwrap_err()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_result_states
  • Loading branch information
dtolnay committed Jul 30, 2022
1 parent aac479a commit 01ef46e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/regression/issue795.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::assertions_on_result_states)]

use serde::de::{
Deserialize, Deserializer, EnumAccess, IgnoredAny, MapAccess, VariantAccess, Visitor,
};
Expand Down
1 change: 1 addition & 0 deletions tests/stream.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![cfg(not(feature = "preserve_order"))]
#![allow(clippy::assertions_on_result_states)]

use serde_json::{json, Deserializer, Value};

Expand Down
1 change: 1 addition & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg(not(feature = "preserve_order"))]
#![allow(
clippy::assertions_on_result_states,
clippy::cast_precision_loss,
clippy::derive_partial_eq_without_eq,
clippy::excessive_precision,
Expand Down

0 comments on commit 01ef46e

Please sign in to comment.