You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you can define default values for any fields of tuple structs, but at the same time cannot define #[serde(default)] on the type itself, which is inconsistent:
Currently, you can define default values for any fields of tuple structs, but at the same time cannot define
#[serde(default)]
on the type itself, which is inconsistent:Actually, the
#[serde(default)]
onu8
is useless here, because this derive generates the following code:If you need to use default value for the field, you should also use it for all subsequent fields. So I propose:
#[serde(default)]
on tuples. Currently an error#[serde(default)] can only be used on structs with named fields
is produced#[serde(default)]
if before them there is a field with#[serde(default)]
#[serde(default)]
The text was updated successfully, but these errors were encountered: