Skip to content

Commit 392a0fb

Browse files
committed
run cargo fmt -- --check on beta
1 parent eebafc7 commit 392a0fb

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ matrix:
1515
- env: TARGET=powerpc64-unknown-linux-gnu
1616
- env: TARGET=powerpc64le-unknown-linux-gnu
1717
- env: TARGET=x86_64-unknown-linux-gnu
18+
- env: TARGET=cargo-fmt
19+
rust: beta
1820

1921
before_install: set -e
2022

2123
install:
2224
- bash ci/install.sh
2325

2426
script:
25-
# code must be already formatted
26-
- cargo fmt -- --check
2727
- bash ci/script.sh
2828

2929
after_script: set +e

ci/install.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
set -euxo pipefail
22

33
main() {
4+
if [ $TARGET = cargo-fmt ]; then
5+
rustup component add rustfmt-preview
6+
return
7+
fi
8+
49
if ! hash cross >/dev/null 2>&1; then
510
cargo install cross
611
fi
712

8-
rustup component add rustfmt-preview
9-
1013
rustup target add x86_64-unknown-linux-musl
1114

1215
if [ $TARGET != x86_64-unknown-linux-gnu ]; then

ci/script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
set -euxo pipefail
22

33
main() {
4+
if [ $TARGET = cargo-fmt ]; then
5+
cargo fmt -- --check
6+
return
7+
fi
8+
49
# quick check
510
cargo check
611

0 commit comments

Comments
 (0)