Skip to content

Commit

Permalink
Ignore single_match_else pedantic clippy lint in test
Browse files Browse the repository at this point in the history
    warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
      --> tests/test_lit.rs:16:5
       |
    16 | /     match TokenStream::from_str(s)
    17 | |         .unwrap()
    18 | |         .into_iter()
    19 | |         .next()
    ...  |
    23 | |         _ => panic!(),
    24 | |     }
       | |_____^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
       = note: `-W clippy::single-match-else` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::single_match_else)]`
    help: try
       |
    16 ~     if let TokenTree::Literal(lit) = TokenStream::from_str(s)
    17 +         .unwrap()
    18 +         .into_iter()
    19 +         .next()
    20 +         .unwrap() { Lit::new(lit) } else { panic!() }
       |
  • Loading branch information
dtolnay committed Oct 2, 2023
1 parent 92fd50e commit 258e9e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_lit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(
clippy::float_cmp,
clippy::non_ascii_literal,
clippy::single_match_else,
clippy::uninlined_format_args
)]

Expand Down

0 comments on commit 258e9e8

Please sign in to comment.