VERS="0.8.4"
if cargo install --list | grep -q "^rustfmt v$VERS"; then
exit 0
fi
if [ "$1" != "--install" ]; then
echo "********************************************************************"
echo "* Please install rustfmt v$VERS to verify formatting. *"
echo "* If a newer version of rustfmt is available, update this script. *"
echo "********************************************************************"
echo "$0 --install"
sleep 1
exit 1
fi
echo "Installing rustfmt v$VERS."
cargo install --force --vers="$VERS" rustfmt