The used derive_builder crate does the checks on runtime. Something like the following will compile but fail at runtime creating hard to find mistakes. Especially as Telegram interactions are not always tested this easily allows for mistakes.
SendMessageParamsBuilder::default().build().expect("I will fail");
I will fail: UninitializedField("chat_id")
typed-builder does this at compile time which will result in less .unwrap(), better performance and less mistakes in production as mistakes are found at compile time. I haven't tried migrating to typed-builder so there might be something preventing it to be used.
Switching the builder system will result in a breaking change but this seems worth it for me.
The used
derive_builder
crate does the checks on runtime. Something like the following will compile but fail at runtime creating hard to find mistakes. Especially as Telegram interactions are not always tested this easily allows for mistakes.typed-builder
does this at compile time which will result in less.unwrap()
, better performance and less mistakes in production as mistakes are found at compile time. I haven't tried migrating to typed-builder so there might be something preventing it to be used.Switching the builder system will result in a breaking change but this seems worth it for me.
Any thought on that?