#!/usr/bin/env bash set -eux default() { check } check() { _fmt _doc _lint _test _examples } _fmt() { cargo fmt --check } _doc() { RUSTDOCFLAGS="-Dwarnings" cargo doc } _lint() { cargo clippy --all-targets --all-features -- -Dwarnings -Dclippy::all -Dclippy::pedantic -Aclippy::module-name-repetitions } _test() { cargo test } _examples() { for example in examples/*.rs; do cargo run --example "$(basename "$example" ".rs")" done } TIMEFORMAT="Completed within %3lR" time ${@:-default}