From 4dec8ecfcef669326686b19ccbf5c406a53535f2 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 26 Nov 2018 03:52:39 -0800 Subject: [PATCH] Check for `cargo fmt` rather than checking for `rustfmt` directly. --- test-all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-all.sh b/test-all.sh index 11b85b0288..0b00566918 100755 --- a/test-all.sh +++ b/test-all.sh @@ -22,13 +22,13 @@ function banner { # Run rustfmt if we have it. banner "Rust formatting" -if type rustfmt > /dev/null; then +if cargo +stable fmt -- --version > /dev/null ; then if ! "$topdir/format-all.sh" --check ; then echo "Formatting diffs detected! Run \"cargo fmt --all\" to correct." exit 1 fi else - echo "rustfmt not available; formatting not checked!" + echo "cargo-fmt not available; formatting not checked!" echo echo "If you are using rustup, rustfmt can be installed via" echo "\"rustup component add --toolchain=stable rustfmt-preview\", or see"