summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-01-19 14:27:38 +0100
committerLinus Färnstrand <linus@mullvad.net>2018-01-19 14:27:38 +0100
commit8b66a953f244dbe04148f550dc7a8c8b4f50d2a0 (patch)
tree8da92b1e1db5c59d2aeececfd2c7eb714a16461d
parent257a5e1e1a0f5a996840c19aeaab1856f805c3fc (diff)
parent6700479fbe2b35fedc740bea71d071f9b673487a (diff)
downloadmullvadvpn-8b66a953f244dbe04148f550dc7a8c8b4f50d2a0.tar.xz
mullvadvpn-8b66a953f244dbe04148f550dc7a8c8b4f50d2a0.zip
Merge branch 'upgrade-rustfmt'
-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