pub fn parse(input: &str) -> Result<Duration, ParseError>Expand description
Parse a strict human duration using default options.
ยงExamples
use std::time::Duration;
use fmt_dur::parse;
assert_eq!(parse("90s").unwrap(), Duration::from_secs(90));
assert_eq!(parse("1.5h").unwrap(), Duration::from_secs(5400));
assert_eq!(parse("2d3h4m").unwrap(), Duration::from_secs(2 * 86_400 + 3 * 3600 + 4 * 60));