Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The SDK implements ToString while it should implement Display for some enums #32

Closed
wiktor-k opened this issue Sep 17, 2024 · 0 comments · Fixed by #33
Closed

The SDK implements ToString while it should implement Display for some enums #32

wiktor-k opened this issue Sep 17, 2024 · 0 comments · Fixed by #33

Comments

@wiktor-k
Copy link
Contributor

I've noticed that some enums such as SystemState implement ToString:

https://github.com/Nitrokey/nethsm-sdk-rs/blob/main/src/models/system_state.rs#L22-L30

Rust docs for ToString explicitly recommend implementing Display instead:

This trait is automatically implemented for any type which implements the Display trait. As such, ToString shouldn’t be implemented directly: Display should be implemented instead, and you get the ToString implementation for free.

wiktor-k added a commit to wiktor-k/nethsm-sdk-rs that referenced this issue Sep 18, 2024
Fixes: Nitrokey#32

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant