ratelimit_meter 0.5.0

A leaky-bucket-as-a-meter rate-limiting implementation in Rust
Documentation
dist: trusty
language: rust
sudo: required
cache: cargo

rust:
  - stable
  - beta
  - nightly

os:
  - linux

env:
  global:
    - CRATE_NAME=ratelimit_meter
    - DEPLOY_VERSION=stable
    - RUN_CLIPPY=false
    - RUSTFMT_VERSION=0.9.0

matrix:
  fast_finish: true # Don't wait for the clippy build - it takes forever /:
  include:
    - rust: nightly
      env: RUN_CLIPPY=true
  allow_failures:
    - rust: nightly
      env: RUN_CLIPPY=true

before_script:
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then
      cargo install --list > /tmp/installed_crates;
      grep "^rustfmt $RUSTFMT_VERSION:" /tmp/installed_crates || cargo install rustfmt --vers $RUSTFMT_VERSION --force ;
    fi'
  - bash -c 'if [[ "$RUN_CLIPPY" == "true" ]]; then
      rm -f ~/.cargo/bin/clippy;
      cargo install clippy --force
      ;
    fi'


script:
  - cargo test
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then
      cargo fmt -v -- --write-mode diff
      ;
    fi'
  - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
      cargo bench
      ;
    fi'
  - bash -c 'if [[ "$RUN_CLIPPY" == "true" ]]; then
      cargo clippy -- -D warnings
      ;
    fi'

branches:
  only:
    # release tags
    - /^v\d+\.\d+\.\d+.*$/
    - master

notifications:
  email:
    on_success: never