Commit 67a0d3b6 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'rustfmt-toolchain-selection'

e193df85 rustfmt: allow selection of the toolchain to use
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !14
parents 58f389b1 e193df85
......@@ -11,6 +11,14 @@ set -e
readonly path="$1"
shift
if [ "$1" = "" ]; then
toolchain=""
else
toolchain="+$1"
shift
fi
readonly toolchain
if ! [ -f "$path" ]; then
echo >&2 'error: could not find file to format: '"$path"
exit 4
......@@ -26,4 +34,4 @@ if ! [ -f ".rustfmt.toml" ] && ! [ -f "rustfmt.toml" ]; then
exit 2
fi
exec rustfmt --write-mode=overwrite --skip-children "$path"
exec rustfmt $toolchain --write-mode=overwrite --skip-children "$path"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment