mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
29 lines
508 B
Rust
29 lines
508 B
Rust
|
#![warn(clippy::unit_hash)]
|
||
|
#![allow(clippy::let_unit_value)]
|
||
|
|
||
|
use std::collections::hash_map::DefaultHasher;
|
||
|
use std::hash::Hash;
|
||
|
|
||
|
enum Foo {
|
||
|
Empty,
|
||
|
WithValue(u8),
|
||
|
}
|
||
|
|
||
|
fn do_nothing() {}
|
||
|
|
||
|
fn main() {
|
||
|
let mut state = DefaultHasher::new();
|
||
|
let my_enum = Foo::Empty;
|
||
|
|
||
|
match my_enum {
|
||
|
Foo::Empty => 0_u8.hash(&mut state),
|
||
|
Foo::WithValue(x) => x.hash(&mut state),
|
||
|
}
|
||
|
|
||
|
let res = ();
|
||
|
0_u8.hash(&mut state);
|
||
|
|
||
|
#[allow(clippy::unit_arg)]
|
||
|
0_u8.hash(&mut state);
|
||
|
}
|