Skip to content

Commit fac1ea7

Browse files
github-actionsseanmonstar
authored andcommitted
doc: update contrib docs
1 parent 2f74552 commit fac1ea7

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

_contrib/code-style.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Code Style
3+
layout: guide
4+
hyper_path: docs/CODE_STYLE.md
5+
---
6+
7+
hyper uses the default configuration of `rustfmt`.
8+
9+
## cargo fmt
10+
11+
`cargo fmt --all` does not work in hyper. Please use the following commands:
12+
13+
```txt
14+
# Mac or Linux
15+
rustfmt --check --edition 2018 $(git ls-files '*.rs')
16+
17+
# Powershell
18+
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
19+
```
20+
21+
> **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:
22+
>
23+
> ```json
24+
> "rust-analyzer.cargo.features": ["full"],
25+
> "rust-analyzer.check.features": ["full"],
26+
> ```

_contrib/contributing.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,3 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li
1212

1313
- [Submitting a Pull Request](pull-requests.md#submitting-a-pull-request)
1414
- [Commit Guidelines](commits.md)
15-
16-
## Cargo fmt
17-
18-
`cargo fmt --all` does not work in hyper. Please use the following commands:
19-
20-
```txt
21-
# Mac or Linux
22-
rustfmt --check --edition 2018 $(git ls-files '*.rs')
23-
24-
# Powershell
25-
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
26-
```
27-
28-
> **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:
29-
>
30-
> ```json
31-
> "rust-analyzer.cargo.features": ["full"],
32-
> "rust-analyzer.check.features": ["full"],
33-
> ```

0 commit comments

Comments
 (0)