Skip to content
New issue

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

Types IsoCode639_X: please derive Copy, Hash, EnumVariantNames, Deserialize and Serialize also #175

Closed
getreu opened this issue Apr 27, 2023 · 0 comments
Milestone

Comments

@getreu
Copy link

getreu commented Apr 27, 2023

The enums IsoCode639_1 and IsoCode639_3 are part of your public API.

Please consider to replace them by the types in the crate codes-iso-639.

If this is not possible, please derive Copy, Hash, EnumString, EnumVariantNames, Deserialize, Serialize also.
This would make them much more useful for the consumer of your API.

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use strum_macros::{EnumString, EnumVariantNames};

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, EnumString, EnumVariantNames)]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[allow(clippy::upper_case_acronyms)]
#[strum(ascii_case_insensitive, serialize_all = "kebab_case")]
pub enum IsoCode639_1 {...}

The same applies to IsoCode639_3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants