Crates.io | pretty-duration |
lib.rs | pretty-duration |
version | 0.1.1 |
source | src |
created_at | 2022-10-28 16:39:34.425629 |
updated_at | 2022-10-28 17:57:32.761238 |
description | Rust library that takes a duration and returns a string that is prettier to read for a human. The format of the duration can be customized in a short and long format and can be localized. |
homepage | https://github.com/MrDesjardins/pretty-duration |
repository | https://github.com/MrDesjardins/pretty-duration |
max_upload_size | |
id | 700528 |
size | 37,610 |
Rust library that takes a duration and returns a string that is prettier to read for a human
cargo add pretty-duration
use pretty_duration::pretty_duration;
use std::time::Duration;
let result = pretty_duration(&Duration::from_millis(1), None);
cargo test
You must install few components before running coverage:
cargo install grcov
rustup component add llvm-tools-preview
Then, you can run:
export RUSTFLAGS="-Cinstrument-coverage"
cargo build
export LLVM_PROFILE_FILE="profile-%p-%m.profraw"
cargo test
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/
Further explanation in the Mozilla grcov website
cargo doc --open
cargo login
cargo publish --dry-run
cargo publish