language: rust
rust:
- 1.31.1
- stable
- beta
- nightly
cache: cargo
before_script:
- if [[ "$TRAVIS_RUST_VERSION" = stable ]]; then rustup component add rustfmt; fi
script:
- if [[ "$TRAVIS_RUST_VERSION" = stable ]]; then cargo fmt --all -- --check; fi
- RUSTFLAGS="-D warnings" cargo check --all || exit
- cargo build
- cargo test