diff --git a/scripts/rust_fmt.sh b/scripts/rust_fmt.sh index db5636de2e..9b3c2f7358 100755 --- a/scripts/rust_fmt.sh +++ b/scripts/rust_fmt.sh @@ -1,3 +1,11 @@ #!/bin/bash -cargo +nightly-2024-08-28 fmt --check --all -- "$@" + +option="--check" + +if [ "$1" == "--fix" ]; then + option="" + shift +fi + +cargo +nightly-2024-08-28 fmt $option --all -- "$@"