• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

baoyachi / duration-str / 21446026744 / 1
73%
master: 73%

Build:
Build:
LAST BUILD BRANCH: merge-deserialize-funcs
DEFAULT BRANCH: master
Ran 28 Jan 2026 04:22PM UTC
Files 6
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Jan 2026 04:14PM UTC coverage: 73.163% (-3.2%) from 76.351%
21446026744.1

Pull #89

github

baoyachi
feat: merge deserialize_duration and deserialize_option_duration into one (#52)

Previously, users needed to choose between deserialize_duration and
deserialize_option_duration based on whether the field was optional.

Now, a single deserialize_duration function works with both Duration
and Option<Duration> fields:

  // Required field
  #[serde(deserialize_with = deserialize_duration)]
  timeout: Duration,

  // Optional field - same function!
  #[serde(default, deserialize_with = deserialize_duration)]
  retry_delay: Option<Duration>,

Implementation:
- Introduce DeserializeDuration trait for Duration and Option<Duration>
- Use generics to dispatch to the correct implementation
- Keep old functions for backward compatibility (deprecated)

Also works for chrono::Duration and time::Duration.
Pull Request #89: feat: merge deserialize_duration and deserialize_option_duration into…

229 of 313 relevant lines covered (73.16%)

2.2 hits per line

Source Files on job 21446026744.1
  • Tree
  • List 6
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 21446026744
  • 17db7c17 on github
  • Prev Job for on merge-deserialize-funcs (#21444407037.1)
  • Next Job for on merge-deserialize-funcs (#21446445995.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc