language: rust
sudo: false
matrix:
  include:
    - rust: stable
      env:
       - NAME="stable"
       - FEATURES=''
    - rust: stable
      env:
       - NAME="stable,fmt"
       - FEATURES=''
       - RUSTFMT=yes
    - rust: stable
      env:
       - NAME="stable,clippy"
       - FEATURES=''
       - CLIPPY=yes
    - rust: nightly
      env:
       - NAME="nightly"
       - FEATURES=''
       - BENCH=1
    - rust: stable
      env:
       - NAME="stable,serialize"
       - FEATURES='serialize'
    - rust: nightly
      env:
       - NAME="nightly,serialize"
       - FEATURES='serialize'
       - BENCH=1
before_script:
    - ([ "$CLIPPY" != yes ] || rustup component add clippy)
    - ([ "$RUSTFMT" != yes ] || rustup component add rustfmt)
script:
    - ([ "$CLIPPY" != yes ] || cargo clippy -- -D clippy::all)
    - ([ "$RUSTFMT" != yes ] || cargo fmt --all -- --check)
    - |
        cargo build --verbose --features "$FEATURES" &&
        cargo test --verbose --features "$FEATURES" &&
        ([ "$BENCH" != 1 ] || cargo bench --verbose --features "$FEATURES")

language: rust
sudo: false
matrix:
  include:
    - rust: stable
      env:
       - NAME="stable"
       - FEATURES=''
    - rust: stable
      env:
       - NAME="stable,fmt"
       - FEATURES=''
       - RUSTFMT=yes
    - rust: stable
      env:
       - NAME="stable,clippy"
       - FEATURES=''
       - CLIPPY=yes
    - rust: nightly
      env:
       - NAME="nightly"
       - FEATURES=''
       - BENCH=1
    - rust: stable
      env:
       - NAME="stable,serialize"
       - FEATURES='serialize'
    - rust: nightly
      env:
       - NAME="nightly,serialize"
       - FEATURES='serialize'
       - BENCH=1
before_script:
    - ([ "$CLIPPY" != yes ] || rustup component add clippy)
    - ([ "$RUSTFMT" != yes ] || rustup component add rustfmt)
script:
    - ([ "$CLIPPY" != yes ] || cargo clippy --all-features -- -D clippy::all)
    - ([ "$RUSTFMT" != yes ] || cargo fmt --all -- --check)
    - |
        cargo build --verbose --features "$FEATURES" &&
        cargo test --verbose --features "$FEATURES" &&
        ([ "$BENCH" != 1 ] || cargo bench --verbose --features "$FEATURES")

Enable clippy checks on all features
Enable clippy checks on all features
