3 ms·
I think the derive_builder crate is worth a mention here: https://docs.rs/derive_builder/0.5.0/derive_builder/ https://docs.rs/derive_builder/0.5.0/derive_buil
by fnord123 9y ago
I think the derive_builder crate is worth a mention here:
https://docs.rs/derive_builder/0.5.0/derive_builder/ https://docs.rs/derive_builder/0.5.0/derive_builder/
- saghm 9y agoThe main reason I haven't used derive_builder much is that I'd much rather have a compile-time guarantee that all the field that I want are filled out than have to check for an error at runtime (or worse, just `unwrap/expect` everywhere). I'm not sure there's currently a way around this on stable, but I'd personally prefer writing boilerplate for my types than having to handle errors in places that shouldn't need them.