Cargo Features

Dur has no features set by default.

[dependencies]
dur = { version = "0.5.3", features = ["std", "alloc", "clap", "serde"] }
std clap? = alloc

Makes Error implement the std::error::Error trait. (Automatically enables the alloc feature).

alloc serde? std?

Enables slightly better error messages by adding the offending string to variant Error::InvalidUnit

clap = std

Enables using Duration directly as an argument in clap.

With error-context and std

serde = alloc

Enables Duration de/serialization through serde.

With alloc