rust/tests/ui-toml/item_name_repetitions/threshold5/item_name_repetitions.rs
jonboh 8b02dac542 add lint for struct field names
side effect for `enum_variants`:
use .first() instead of .get(0) in enum_variants lint
move to_camel_case to str_util module
move module, enum and struct name repetitions check to a single file `item_name_repetitions`
rename enum_variants threshold config option
2023-10-18 19:20:08 +02:00

33 lines
446 B
Rust

#![warn(clippy::struct_field_names)]
struct Data {
a_data: u8,
b_data: u8,
c_data: u8,
d_data: u8,
}
struct Data2 {
//~^ ERROR: all fields have the same postfix
a_data: u8,
b_data: u8,
c_data: u8,
d_data: u8,
e_data: u8,
}
enum Foo {
AFoo,
BFoo,
CFoo,
DFoo,
}
enum Foo2 {
//~^ ERROR: all variants have the same postfix
AFoo,
BFoo,
CFoo,
DFoo,
EFoo,
}
fn main() {}