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

feat: add fmt::Display for Version to improve usage #759

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ljahier
Copy link

@ljahier ljahier commented Mar 14, 2025

Hey maintainer,

I've implemented the Display trait for the Version enum to align its use with other components such as Uri and Method.

This enhancement simplifies code when working with libraries such as Axum, which exploits the http crate. Previously, converting a Version into a string (for inclusion in OpenTelemetry span in my case) required the use of the format! macro!

With this implementation, we can now call .to_string() directly on Version instances, simplifying the code base and improving readability.

@ljahier ljahier marked this pull request as draft March 14, 2025 16:42
@ljahier ljahier marked this pull request as ready for review March 14, 2025 16:49
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.

1 participant