Skip to content

Commit 526367a

Browse files
authored
Merge pull request #2411 from topecongiro/update-travis
Update a minimal travis example
2 parents 346238f + 0910883 commit 526367a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,25 +143,20 @@ when a pull request contains unformatted code. Using `--write-mode=diff` instruc
143143
rustfmt to exit with an error code if the input is not formatted correctly.
144144
It will also print any found differences.
145145

146-
(These instructions use the nightly version of Rustfmt. If you want to use the
147-
Syntex version replace `install rustfmt-nightly` with `install rustfmt`).
148-
149146
A minimal Travis setup could look like this:
150147

151148
```yaml
152149
language: rust
153-
cache: cargo
154150
before_script:
155-
- export PATH="$PATH:$HOME/.cargo/bin"
156-
- which rustfmt || cargo install rustfmt-nightly
151+
- rustup toolchain install nightly
152+
- rustup component add --toolchain nightly rustfmt-preview
153+
- which rustfmt || cargo install --force rustfmt-nightly
157154
script:
158-
- cargo fmt -- --write-mode=diff
155+
- cargo +nightly fmt --all -- --write-mode=diff
159156
- cargo build
160157
- cargo test
161158
```
162159
163-
Note that using `cache: cargo` is optional but highly recommended to speed up the installation.
164-
165160
## How to build and test
166161
167162
`cargo build` to build.

0 commit comments

Comments
 (0)