Skip to content

Commit cd15469

Browse files
committed
doc(contrib): move cargo fmt notes to CODE_STYLE.md
1 parent d7680e3 commit cd15469

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

CONTRIBUTING.md

-19
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,3 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li
88

99
- [Submitting a Pull Request](./docs/PULL_REQUESTS.md#submitting-a-pull-request)
1010
- [Commit Guidelines](./docs/COMMITS.md)
11-
12-
## Cargo fmt
13-
14-
`cargo fmt --all` does not work in hyper. Please use the following commands:
15-
16-
```txt
17-
# Mac or Linux
18-
rustfmt --check --edition 2018 $(git ls-files '*.rs')
19-
20-
# Powershell
21-
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
22-
```
23-
24-
> **NOTE**: If you are using `rust-analyzer`, you can add the following two lines in your `settings.json` to make sure the features get taken into account when checking the project:
25-
>
26-
> ```json
27-
> "rust-analyzer.cargo.features": ["full"],
28-
> "rust-analyzer.check.features": ["full"],
29-
> ```

docs/CODE_STYLE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Code Style
2+
3+
hyper uses the default configuration of `rustfmt`.
4+
5+
## cargo fmt
6+
7+
`cargo fmt --all` does not work in hyper. Please use the following commands:
8+
9+
```txt
10+
# Mac or Linux
11+
rustfmt --check --edition 2018 $(git ls-files '*.rs')
12+
13+
# Powershell
14+
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
15+
```
16+
17+
> **NOTE**: If you are using `rust-analyzer`, you can add the following two lines in your `settings.json` to make sure the features get taken into account when checking the project:
18+
>
19+
> ```json
20+
> "rust-analyzer.cargo.features": ["full"],
21+
> "rust-analyzer.check.features": ["full"],
22+
> ```

0 commit comments

Comments
 (0)