News for hackers. Stuff that matters.
Re:The Phantom Builder in Rust by saghm on Thursday March 28, 2019 @05:13PM (#19516684)
For those who want to use the builder pattern in Rust but don't want to write the boilerplate, I've found the typed-builder crate (https://github.com/idanarye/rust-typed-builder) to be an excellent solution. It ensures (at compile time!) that you have initialized all the fields of your struct that are not explicitly marked as having default values.

Disclaimer: I don't have any affiliation with this crate; I'm just a big fan

There are no comments on this comment yet.