Clippy struggles a bit with code generated by derive macros. It currently detects some enum generated by #[derive(TypedBuilder)], if clippy::exhaustive_enums is enabled.
Reproducer:
#![warn(clippy::exhaustive_enums)]
use typed_builder::TypedBuilder;
#[derive(TypedBuilder)]
pub struct Bar {
pub a: i32,
pub b: String,
}
Now run cargo clippy
Fix
The easiest fix would probably be to generate a #[allow(clippy::exhaustive_enums)] above the enum. That would simply suppress the lint for this specific enum. For my use case, it's totally fine, that the enum is non_exhaustive.
Clippy struggles a bit with code generated by derive macros. It currently detects some enum generated by
#[derive(TypedBuilder)]
, ifclippy::exhaustive_enums
is enabled.Reproducer:
Now run
cargo clippy
Fix
The easiest fix would probably be to generate a
#[allow(clippy::exhaustive_enums)]
above the enum. That would simply suppress the lint for this specific enum. For my use case, it's totally fine, that the enum is non_exhaustive.