From d555b1e96770406cbf3a7d8aeb56785dfb7ab8d4 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 7 Jun 2026 07:16:55 -0400 Subject: Prepare 0.1 release --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 0289b15..55b2b5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -163,6 +163,8 @@ pub fn derive_builder(input: TokenStream) -> TokenStream { .ok() .flatten() .or_else(|| { + // a normal struct can be constructed if all of the fields are public, so + // it makes sense to also allow a builder in this case. fields .iter() .all(|field| matches!(field.visibility, Visibility::Public(_))) @@ -258,10 +260,12 @@ pub fn derive_builder(input: TokenStream) -> TokenStream { }); quote! { + #[doc(hidden)] #builder_visibility struct #builder_name<#(const #const_generics: bool),*> { #(#field_names: Option<#field_types>,)* } + // using impl instead of derive to improve compilation time impl<#(const #const_generics: bool),*> core::default::Default for #builder_name<#(#const_generics),*> { fn default() -> Self { Self { -- cgit v1.2.3