summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xformat.sh7
-rw-r--r--rustfmt.toml2
2 files changed, 5 insertions, 4 deletions
diff --git a/format.sh b/format.sh
index cc82f8e25a..8fe6fd7787 100755
--- a/format.sh
+++ b/format.sh
@@ -5,14 +5,13 @@
set -u
-VERSION="0.3.5"
+VERSION=`grep "required_version" rustfmt.toml | cut -f2 -d'"'`
CMD="rustfmt"
-INSTALL_CMD="cargo install --vers $VERSION --force rustfmt-nightly"
+INSTALL_CMD="cargo +nightly install --vers $VERSION --force rustfmt-nightly"
case "$(uname -s)" in
Linux*) export LD_LIBRARY_PATH=$(rustc +nightly --print sysroot)/lib;;
Darwin*) export DYLD_LIBRARY_PATH=$(rustc +nightly --print sysroot)/lib;;
- *) echo "Unsupported platform"; exit 1
esac
function correct_rustfmt() {
@@ -37,5 +36,5 @@ else
shift
fi
-echo "Formatting..."
+echo "Formatting with $VERSION..."
cargo +nightly fmt -- "$@"
diff --git a/rustfmt.toml b/rustfmt.toml
index 75d71f4a8d..4af6ba9f6d 100644
--- a/rustfmt.toml
+++ b/rustfmt.toml
@@ -1,3 +1,5 @@
+required_version = "0.3.6"
+
# Activation of features, almost objectively better ;)
reorder_imports = true
reorder_imported_names = true