sudo: false
language: rust
rust:
  - stable
  - beta
  - nightly
matrix:
  allow_failures:
    - rust: nightly
before_install:
  # Add Rust binaries to path
  - export PATH="$HOME/.cargo/bin:$PATH"
  # Install rustfmt if it does not already exist
  - if [[ ! -x "$HOME/.cargo/bin/cargo-fmt" ]]; then cargo install rustfmt; fi
script:
  # Check formatting of sources
  - cargo fmt -- --write-mode=diff
  - cargo build --verbose
  - cargo test --verbose
  - cargo bench --verbose
cache: cargo

sudo: false
language: rust
rust:
  - stable
  - beta
  - nightly
matrix:
  allow_failures:
    - rust: nightly
before_install:
  # Add Rust binaries to path
  - export PATH="$HOME/.cargo/bin:$PATH"
  # Install rustfmt if it does not already exist
  - if [[ ! -x "$HOME/.cargo/bin/cargo-fmt" ]]; then cargo install rustfmt; fi
  # On nightly install clippy
  - if [[ ! -x "$HOME/.cargo/bin/cargo-clippy" && "$TRAVIS_RUST_VERSION" == "nightly"]]; then cargo install clippy; fi
script:
  # Check formatting of sources
  - cargo fmt -- --write-mode=diff
  - cargo build --verbose
  - if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then cargo clippy --verbose; fi
  - cargo test --verbose
  - cargo bench --verbose
cache: cargo

Enable clippy on Travis CI
Enable clippy on Travis CI
