mirror of
https://github.com/serde-rs/serde.git
synced 2025-09-28 13:30:48 +00:00

std::time::Duration::new can panic. There is no alternative non-panicing constructor. Check the panic condition beforehand and return an error instead of panicing. Fixes #1933