Skip to content

Commit abd7607

Browse files
committed
build: Use rustfmt from lastest nightly that contains it
1 parent e8642c7 commit abd7607

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ install:
3232
- |
3333
if [[ -z ${INTEGRATION} ]]; then
3434
if ! rustup component add rustfmt; then
35-
cargo install --git https://github.com/rust-lang/rustfmt --bin rustfmt
35+
TARGET=$(rustc -Vv | awk '/host/{print $2}')
36+
NIGHTLY=$(curl -s "https://rust-lang.github.io/rustup-components-history/${TARGET}/rustfmt")
37+
curl -sSL "https://static.rust-lang.org/dist/${NIGHTLY}/rustfmt-nightly-${TARGET}.tar.xz" | \
38+
tar -xJf - --strip-components=3 -C ~/.cargo/bin
39+
rm -rf ~/.cargo/bin/doc
3640
fi
3741
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
3842
. $HOME/.nvm/nvm.sh

0 commit comments

Comments
 (0)