From 424a42fcb63f75d58d187ca329a664197d25ceb9 Mon Sep 17 00:00:00 2001 From: Hu# Date: Wed, 8 Nov 2023 04:26:28 +0800 Subject: [PATCH] docs(contributing.md): add a comment to make good use of `rust-analyzer` (#3388) --- CONTRIBUTING.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae904d6b50..43b0097d37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,18 +4,26 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li [easy tag]: https://github.com/hyperium/hyper/issues?q=label%3AE-easy+is%3Aopen - ## [Pull Requests](./docs/PULL_REQUESTS.md) - [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 } -``` \ No newline at end of file +``` + +> **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"], +> ```