rust/tests/ui/unit_like_struct_brackets.fixed

15 lines
325 B
Rust
Raw Normal View History

2022-03-27 14:16:08 +02:00
// run-rustfix
#![warn(clippy::unit_like_struct_brackets)]
#![allow(dead_code)]
2022-03-27 14:41:09 +02:00
pub struct MyEmptyStruct; // should trigger lint
struct MyEmptyTupleStruct; // should trigger lint
2022-03-27 14:16:08 +02:00
2022-03-27 14:41:09 +02:00
struct MyStruct {
// should not trigger lint
2022-03-27 14:16:08 +02:00
field: u8,
}
2022-03-27 14:41:09 +02:00
struct MyTupleStruct(usize, String); // should not trigger lint
2022-03-27 14:16:08 +02:00
fn main() {}