de-vri-es / serial2-rs

Cross platform serial ports for Rust
Other
41 stars 10 forks source link

Implement Display for Enums #21

Closed hacknus closed 6 months ago

hacknus commented 6 months ago

Implementing Display for CharSize, StopBits, Parity and FlowControl can be useful for using serial2-rs in a GUI.

de-vri-es commented 6 months ago

Thanks for the PR, I think it makes sense to add this!

I think it's better if the Display implementation to use the same format as the serde::Serialize implementation. So CharSize and StopBits should just delegate to the Display implementation of u8 and Parity and FlowControl should use the same strings as the serialization.

hacknus commented 6 months ago

Yes, that's a great input, I applied some changes.

de-vri-es commented 6 months ago

Makes sense! Thanks for the PR!

de-vri-es commented 6 months ago

Released with v0.2.13! :rocket: