-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f74552
commit fac1ea7
Showing
2 changed files
with
26 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Code Style | ||
layout: guide | ||
hyper_path: docs/CODE_STYLE.md | ||
--- | ||
|
||
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"], | ||
> ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters