Commit e193df85 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

rustfmt: allow selection of the toolchain to use

parent 1557bcef
......@@ -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