Skip to content

Commit

Permalink
doc(contrib): move cargo fmt notes to CODE_STYLE.md
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Jan 19, 2024
1 parent d7680e3 commit cd15469
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
19 changes: 0 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,3 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li

- [Submitting a Pull Request](./docs/PULL_REQUESTS.md#submitting-a-pull-request)
- [Commit Guidelines](./docs/COMMITS.md)

## Cargo fmt

`cargo fmt --all` does not work in hyper. Please use the following commands:

```txt
# Mac or Linux
rustfmt --check --edition 2018 $(git ls-files '*.rs')
# Powershell
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
```

> **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:
>
> ```json
> "rust-analyzer.cargo.features": ["full"],
> "rust-analyzer.check.features": ["full"],
> ```
22 changes: 22 additions & 0 deletions docs/CODE_STYLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Code Style

hyper uses the default configuration of `rustfmt`.

## cargo fmt

`cargo fmt --all` does not work in hyper. Please use the following commands:

```txt
# Mac or Linux
rustfmt --check --edition 2018 $(git ls-files '*.rs')
# Powershell
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
```

> **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:
>
> ```json
> "rust-analyzer.cargo.features": ["full"],
> "rust-analyzer.check.features": ["full"],
> ```

1 comment on commit cd15469

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'end_to_end'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: cd15469 Previous: d7680e3 Ratio
http2_parallel_x10_req_10kb_100_chunks_adaptive_window 24040801 ns/iter (± 18412803) 7891073 ns/iter (± 323924) 3.05

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.