We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's say we have a simple strum enfused enum and we want both display and serialization be lowercase.
#[derive(Serialize, Deserialize, Display, Clone, Debug, Default, PartialEq, EnumString)] //#[serde(rename_all = "lowercase")] #[strum(serialize_all = "lowercase")] pub enum Status { Online, Medium, #[default] Offline, } ... #[test] fn enum_serialize() { let status = Status::Offline; assert_eq!("offline", status.to_string()); }
Strum version will lead for this to be lowecase whereas serde rename_all will not. With serialization it's right the opposite.
What is the gotcha here?
Edit: I guess @kraktus is right, but it feels wrong setting duplicating logic for both serialization and code usage.
anything we can do here? strum is a cool minimalistic part of ecosystem and everyone will benefit if it became more convenient
The text was updated successfully, but these errors were encountered:
Isn't the catch just that strum only apply to the ToString trait while serve only applies to the Serialize one?
strum
ToString
Serialize
Sorry, something went wrong.
No branches or pull requests
Let's say we have a simple strum enfused enum and we want both display and serialization be lowercase.
Strum version will lead for this to be lowecase whereas serde rename_all will not.
With serialization it's right the opposite.
What is the gotcha here?
Edit: I guess @kraktus is right, but it feels wrong setting duplicating logic for both serialization and code usage.
anything we can do here? strum is a cool minimalistic part of ecosystem and everyone will benefit if it became more convenient
The text was updated successfully, but these errors were encountered: