Skip to content

Commit c2ea7f0

Browse files
committed
Remove extra parentheses from tools/fmt.sh
1 parent 6699d7c commit c2ea7f0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tools/fmt.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
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.
10+
911
# Refs: https://github.com/rust-lang/rustfmt/issues/4078
1012

1113
set -euo pipefail
@@ -15,12 +17,13 @@ cd "$(cd "$(dirname "${0}")" && pwd)"/..
1517

1618
# shellcheck disable=SC2046
1719
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")
2224
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")
2629
fi

0 commit comments

Comments
 (0)