镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Open
ljahier wants to merge 1 commit into
hyperium:masterfrom
ljahier:feature/impl-display-for-version
Open

ljahier wants to merge 1 commit into
hyperium:masterfrom
ljahier:feature/impl-display-for-version

Conversation

@ljahier

@ljahier ljahier commented Mar 14, 2025

Copy link
Copy Markdown

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

This branch has not been deployed

No deployments
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