feat(test): use new rustfmt-preview

master
Ashley Williams 7 years ago
parent c8b702c061
commit 4c54996abd
  1. 5
      .travis.yml
  2. 2
      src/lib.rs
  3. 13
      tests/scripts/rustfmt.sh

@ -6,12 +6,11 @@ rust:
- stable
- beta
- nightly
before_install:
- bash ./tests/scripts/rustfmt.sh
script:
- cargo fmt -- --write-mode diff
- cargo test
- rustup component add rustfmt-preview
- cargo fmt -- --write-mode diff
matrix:
allow_failures:
- rust: nightly

@ -1,8 +1,8 @@
extern crate failure;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate toml;
extern crate failure;
use std::fs::File;
use std::io::prelude::*;

@ -1,13 +0,0 @@
#!/bin/bash
which rustfmt > /dev/null
if [[ $? -ne 0 ]]; then
cargo install rustfmt
else
current_version=$(rustfmt --version | cut -d '-' -f 1 | xargs)
upstream_version=$(cargo search rustfmt | head -n 1 | cut -d ' ' -f 3 | tr -d '"' | xargs)
if [ $current_version != $upstream_version ]; then
cargo install rustfmt --force
fi
fi
Loading…
Cancel
Save