#!/bin/bash

set -euo pipefail

d=$(dirname "${BASH_SOURCE[0]}")
source "$d/shared.sh"

maybe_install_rustup
install_rustfmt
cargo_fmt="cargo +$toolchain fmt --all -- --check"
echo "--- :rust: Running cargo fmt command: $cargo_fmt"
$cargo_fmt

#!/bin/bash

set -euo pipefail

d=$(dirname "${BASH_SOURCE[0]}")
source "$d/shared.sh"

# Thanks to the magic of global variables, this value will get overwritten when
# install_rustfmt runs. But, if we don't declare it up front here, shellcheck
# errors on the cargo_fmt statement below.
toolchain="stable"

maybe_install_rustup
install_rustfmt
cargo_fmt="cargo +$toolchain fmt --all -- --check"
echo "--- :rust: Running cargo fmt command: $cargo_fmt"
$cargo_fmt

Declare toolchain up front, to avoid shellcheck errors
Declare toolchain up front, to avoid shellcheck errors

Signed-off-by: Josh Black <2831680e59d3b8be5b278b69b4e783c575edf378@gmail.com>
