b276849ce1
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