From 0cf6f3d6433d99449cf794517b47c355fb71680a Mon Sep 17 00:00:00 2001 From: Idan Arye Date: Mon, 18 Sep 2023 19:01:37 +0300 Subject: [PATCH] Fix #112: Add `#[allow(clippy::exhaustive_enums)]` to generated empty enums used for error "reporting" --- CHANGELOG.md | 3 +++ typed-builder-macro/src/struct_info.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de3385aa..22cfd2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Add `#[allow(clippy::exhaustive_enums)]` to generated empty enums used for + error "reporting" (see issue #112) ## 0.16.0 - 2023-08-26 ### Added diff --git a/typed-builder-macro/src/struct_info.rs b/typed-builder-macro/src/struct_info.rs index 9fc63665..19db9d48 100644 --- a/typed-builder-macro/src/struct_info.rs +++ b/typed-builder-macro/src/struct_info.rs @@ -280,6 +280,7 @@ impl<'a> StructInfo<'a> { } #[doc(hidden)] #[allow(dead_code, non_camel_case_types, non_snake_case)] + #[allow(clippy::exhaustive_enums)] pub enum #repeated_fields_error_type_name {} #[doc(hidden)] #[allow(dead_code, non_camel_case_types, missing_docs)] @@ -368,6 +369,7 @@ impl<'a> StructInfo<'a> { quote! { #[doc(hidden)] #[allow(dead_code, non_camel_case_types, non_snake_case)] + #[allow(clippy::exhaustive_enums)] pub enum #early_build_error_type_name {} #[doc(hidden)] #[allow(dead_code, non_camel_case_types, missing_docs, clippy::panic)]