File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 5
5
# Usage:
6
6
# ./tools/fmt.sh
7
7
#
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.
9
10
# Refs: https://github.com/rust-lang/rustfmt/issues/4078
10
11
11
12
set -euo pipefail
@@ -15,12 +16,13 @@ cd "$(cd "$(dirname "${0}")" && pwd)"/..
15
16
16
17
# shellcheck disable=SC2046
17
18
if [[ -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 " )
22
23
else
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" )
26
28
fi
You can’t perform that action at this time.
0 commit comments