http icon indicating copy to clipboard operation
http copied to clipboard

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

Open ljahier opened this issue 9 months ago • 0 comments

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 avatar Mar 14 '25 16:03 ljahier