v2.2.0
See the blog post for this release that describes some of the most notable changes in detail.
Changed
-
The
#[bon::builder]
attribute was deprecated on structs. The new#[derive(bon::Builder)]
should be used to derive a builder from a struct. Starting withbon
2.3 (next minor release) all usages of#[bon::builder]
on structs will generate deprecation warnings. (#99).There is a CLI to assist in migrating to the new syntax. See the release blog post for details about that.
Added
-
Add the top-level
#[builder(derive(...))]
attribute to be able to deriveClone
andDebug
for the builder type itself (#113) -
Add support for conditional compilation with
cfg/cfg_attr
(#99)
Fixed
- Fix developer experience in Rust Rover. The new
#[derive(Builder)]
syntax should now be easier for Rust Rover to analyze (#99) - Fix a bug where a member of opaque
Option
type (i.e. theOption
type that was renamed to make the builder macro not detect it asOption
) was still optional. (#99) - Fix code generation for structs with default values for generic parameters (#108)