colin-kiegel / rust-derive-builder

derive builder implementation for rust structs
https://colin-kiegel.github.io/rust-derive-builder/
Apache License 2.0
1.28k stars 82 forks source link

Feature request: infallible `build` #328

Closed BatmanAoD closed 1 month ago

BatmanAoD commented 1 month ago

In the case where every field has a default, build should be infallible.

It would be nice if there were a way to explicitly request this, e.g. by deriving BuilderInfallible instead of Builder, so that derivation would fail if any fields lack a default, and build() does not return a Result.

BatmanAoD commented 1 month ago

Oops, never mind, I see this has been discussed before and not implemented: https://github.com/colin-kiegel/rust-derive-builder/issues/56