Replies: 3 comments 3 replies
-
We shouldn't add When I added Not all the fields of the confirmation should be added to the CLI, and Anyway, |
Beta Was this translation helpful? Give feedback.
-
Maybe it is time to create |
Beta Was this translation helpful? Give feedback.
-
Implemented. |
Beta Was this translation helpful? Give feedback.
-
I’m starting work on the
Partial
derive macro, which is supposed to take a struct and generate a companion struct where every field is wrapped inOption
(for context, see my original proposal: #1460 (comment)).Now I’m wondering how opinionated I should make that macro. Given that we are introducing this macro for the purpose of easing the way we implement configuration merging, I think somewhat opinionated makes sense.
For instance, all the structs we apply this too also derive serde’s
Serialize
andDeserialize
. Given that every field will become anOption
, I think it only makes sense if the macro inserts the line#[serde(skip_serializing_if = "Option::is_none")]
for you. It doesn’t only save us from repetition, it also prevents mistakes, since I already see a few fields where it was forgotten (I don’t think these omissions were intentional).But what about
bpaf
?biome_deserialize
doesn’t depend onbpaf
, so it feels weird if the macro does similar things there, even though it could. But I think it might be useful if it could just insert#[bpaf(hide)]
for any fields that don't any otherbpaf
attributes.Let me know what you think!
Beta Was this translation helpful? Give feedback.
All reactions