Rust library that takes a duration and returns a string that is prettier to read for a human
sh
cargo add pretty-duration
sh
use pretty_duration::pretty_duration;
use std::time::Duration;
let result = pretty_duration(&Duration::from_millis(1), None);
sh
cargo test
You must install few components before running coverage:
sh
cargo install grcov
rustup component add llvm-tools-preview
Then, you can run:
sh
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
sh
cargo doc --open
sh
cargo login
cargo publish --dry-run
cargo publish