Skip to content

Conversation

@TheBeardedQuack
Copy link

Many enums in the crate provide the Display trait, while very few provide FromStr.
The FlowControl enum for example has been provided with both traits, while DataBits, StopBits and Partity enums feature only the Display trait.

Added FromStr imlementation to these three enums to improve completeness and assist in applications that require converting from a string in the UI into these enum values.

@RossSmyth
Copy link
Contributor

Hm I didn't realize that Display had been implemented, I would have raised objections to that as I don't think that is really within the purview of this crate. Mainly because internationalization is very relevant within this sort of crate. I think Debug is great, but Display is a bit weird since the enums shouldn't really be used directly for formatting, and internationalization is extremely relevant for this sort of API, and all this shows is English.

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

Successfully merging this pull request may close these issues.

2 participants