File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 55# Usage:
66# ./tools/fmt.sh
77#
8- # This script is needed because `cargo fmt` cannot recognize modules defined inside macros.
8+ # This is similar to `cargo fmt`, but unlike `cargo fmt`, it can recognize
9+ # modules defined inside macros.
910# Refs: https://github.com/rust-lang/rustfmt/issues/4078
1011
1112set -euo pipefail
@@ -15,12 +16,13 @@ cd "$(cd "$(dirname "${0}")" && pwd)"/..
1516
1617# shellcheck disable=SC2046
1718if [[ -z " ${CI:- } " ]]; then
18- (
19- # `cargo fmt` cannot recognize modules defined inside macros so run rustfmt directly.
20- rustfmt $( git ls-files " *.rs " )
21- )
19+ # `cargo fmt` cannot recognize modules defined inside macros, so run
20+ # rustfmt directly.
21+ # Refs: https://github.com/rust-lang/rustfmt/issues/4078
22+ rustfmt $( git ls-files " *.rs " )
2223else
23- (
24- rustfmt --check $( git ls-files " *.rs" )
25- )
24+ # `cargo fmt` cannot recognize modules defined inside macros, so run
25+ # rustfmt directly.
26+ # Refs: https://github.com/rust-lang/rustfmt/issues/4078
27+ rustfmt --check $( git ls-files " *.rs" )
2628fi
You can’t perform that action at this time.
0 commit comments