File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-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.
10
+
9
11
# Refs: https://github.com/rust-lang/rustfmt/issues/4078
10
12
11
13
set -euo pipefail
@@ -15,12 +17,13 @@ cd "$(cd "$(dirname "${0}")" && pwd)"/..
15
17
16
18
# shellcheck disable=SC2046
17
19
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
- )
20
+ # `cargo fmt` cannot recognize modules defined inside macros, so run
21
+ # rustfmt directly.
22
+ # Refs: https://github.com/rust-lang/rustfmt/issues/4078
23
+ rustfmt $( git ls-files " *.rs " )
22
24
else
23
- (
24
- rustfmt --check $( git ls-files " *.rs" )
25
- )
25
+ # `cargo fmt` cannot recognize modules defined inside macros, so run
26
+ # rustfmt directly.
27
+ # Refs: https://github.com/rust-lang/rustfmt/issues/4078
28
+ rustfmt --check $( git ls-files " *.rs" )
26
29
fi
You can’t perform that action at this time.
0 commit comments