From 0910883cf29e122c9b69ad161515c79024ca9fd6 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Sun, 4 Feb 2018 10:02:45 +0900 Subject: [PATCH] Update a minimal travis example --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dca58cc620cb..86dc4dd8d300 100644 --- a/README.md +++ b/README.md @@ -143,25 +143,20 @@ when a pull request contains unformatted code. Using `--write-mode=diff` instruc rustfmt to exit with an error code if the input is not formatted correctly. It will also print any found differences. -(These instructions use the nightly version of Rustfmt. If you want to use the -Syntex version replace `install rustfmt-nightly` with `install rustfmt`). - A minimal Travis setup could look like this: ```yaml language: rust -cache: cargo before_script: -- export PATH="$PATH:$HOME/.cargo/bin" -- which rustfmt || cargo install rustfmt-nightly +- rustup toolchain install nightly +- rustup component add --toolchain nightly rustfmt-preview +- which rustfmt || cargo install --force rustfmt-nightly script: -- cargo fmt -- --write-mode=diff +- cargo +nightly fmt --all -- --write-mode=diff - cargo build - cargo test ``` -Note that using `cache: cargo` is optional but highly recommended to speed up the installation. - ## How to build and test `cargo build` to build.