Use the latest toolchain with rustfmt available if rustfmt is unavailable on the latest nightly (#155)

staging
Atul Bhosale 5 years ago committed by Stjepan Glavina
parent 481002ee71
commit 5d73776c69

@ -18,8 +18,14 @@ matrix:
- name: fmt
rust: nightly
os: linux
before_script:
- rustup component add rustfmt
before_script: |
if ! rustup component add rustfmt; then
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt`;
echo "'rustfmt' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
rustup toolchain install nightly-$target;
rustup default nightly-$target;
rustup component add rustfmt;
fi
script:
- cargo fmt --all -- --check

Loading…
Cancel
Save