image: "rust"

tests:
  before_script:
    - rustup install nightly
  script:
    - cargo +nightly test

format:
  before_script:
    - rustup install nightly
    - rustup +nightly component add rustfmt
  script:
    - cargo +nightly fmt -- --check

clippy:
  before_script:
    - rustup install nightly
    - rustup +nightly component add clippy
  script:
    - if cargo +nightly clippy 2>&1 | tee /dev/stderr | egrep "^(warning|error):" >/dev/null ; then exit 1 ; else exit 0 ; fi