jonasbb / serde_with

This crate provides custom de/serialization helpers to use in combination with serde's `with`-annotation and with the improved `serde_as`-annotation.
https://docs.rs/serde_with
Apache License 2.0
667 stars 72 forks source link

feat(serde_with): add `with_suffix!` #797

Closed fgardt closed 2 weeks ago

fgardt commented 3 weeks ago

This should properly close #381.

Apart from the used example it is pretty much identical to the existing with_prefix! code, except for the few places that actually do the suffixing / trimming.

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 56.33803% with 62 lines in your changes missing coverage. Please review.

Project coverage is 66.91%. Comparing base (2d70b70) to head (2b4658c). Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
serde_with/src/with_suffix.rs 56.33% 62 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #797 +/- ## ========================================== - Coverage 67.34% 66.91% -0.43% ========================================== Files 40 41 +1 Lines 2468 2639 +171 ========================================== + Hits 1662 1766 +104 - Misses 806 873 +67 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jonasbb commented 2 weeks ago

Thank you for doing the work of adding with_suffix!. Since it is mostly a copy, I don't see a problem here. I like that you added a proper new example to the documentation :)