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

Implement Display for svix_ksuid::Ksuid #2

Closed
indiv0 opened this issue May 17, 2022 · 2 comments · Fixed by #3
Closed

Implement Display for svix_ksuid::Ksuid #2

indiv0 opened this issue May 17, 2022 · 2 comments · Fixed by #3

Comments

@indiv0
Copy link

indiv0 commented May 17, 2022

Feature Request

Motivation

Hi! I'm not sure if this is intentional, but it looks like Ksuid doesn't implement Display.
This means that to print it out you need to do format!("{}", ksuid.to_string()) rather than just format!("{}", ksuid).
Not a big deal, but adds some verbosity.

Proposal

Implementing Display should be as simple as moving the existing to_string logic into a Display impl.
I'm not sure if the type doesn't implement Display intentionally though. Perhaps this was done to avoid some API guarantees?

Alternatives

N/A

@indiv0 indiv0 changed the title Implement Display to svix_ksuid::Ksuid Implement Display for svix_ksuid::Ksuid May 17, 2022
@tasn
Copy link
Member

tasn commented May 18, 2022

Thanks for the suggestion, this was just a silly oversight!

Would you prefer to write the PR yourself (so you get the attribution), or have me write it?

@indiv0
Copy link
Author

indiv0 commented May 18, 2022

Go ahead, I'm OK with just having the feature added 😄

tasn added a commit that referenced this issue May 18, 2022
We shouldn't be implementing ToString directly, but rather Display.

Fixes #2.
@tasn tasn closed this as completed in #3 May 18, 2022
tasn added a commit that referenced this issue May 18, 2022
We shouldn't be implementing ToString directly, but rather Display.

Fixes #2.
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 a pull request may close this issue.

2 participants