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

feat: Implement Display for enums #33

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

wiktor-k
Copy link
Contributor

I've updated the template and run update_openapi.sh.

It should make it easier for Rust devs a bit. Please test as I'm not that familiar with openapi-generator (it does compiles and renders nice docs though).

(btw, I've also locally used podman instead of docker which has a nice effect of not having to require a docker daemon)

Fixes: #32

wiktor-k added a commit to wiktor-k/openapi-generator that referenced this pull request Sep 18, 2024
Rust docs for `ToString` explicitly recommend implementing `Display`:

> 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.

See: https://doc.rust-lang.org/std/string/trait.ToString.html
See: Nitrokey/nethsm-sdk-rs#33
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Fixes: Nitrokey#32

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
@robin-nitrokey robin-nitrokey force-pushed the wiktor/implement-display branch from 7efb9df to 1e8519c Compare September 18, 2024 09:54
@robin-nitrokey robin-nitrokey merged commit 1e8519c into Nitrokey:main Sep 18, 2024
3 checks passed
@wiktor-k wiktor-k deleted the wiktor/implement-display branch September 18, 2024 09:57
@robin-nitrokey
Copy link
Member

Thank you!

wiktor-k added a commit to wiktor-k/openapi-generator that referenced this pull request Sep 23, 2024
Rust docs for `ToString` explicitly recommend implementing `Display`:

> 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.

See: https://doc.rust-lang.org/std/string/trait.ToString.html
See: Nitrokey/nethsm-sdk-rs#33
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
wing328 pushed a commit to OpenAPITools/openapi-generator that referenced this pull request Sep 24, 2024
Rust docs for `ToString` explicitly recommend implementing `Display`:

> 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.

See: https://doc.rust-lang.org/std/string/trait.ToString.html
See: Nitrokey/nethsm-sdk-rs#33

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 this pull request may close these issues.

The SDK implements ToString while it should implement Display for some enums
2 participants