Skip to content

Commit c359ebf

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

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tools/fmt.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
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

1112
set -euo pipefail
@@ -15,12 +16,13 @@ cd "$(cd "$(dirname "${0}")" && pwd)"/..
1516

1617
# shellcheck disable=SC2046
1718
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")
2223
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")
2628
fi

0 commit comments

Comments
 (0)