Updated some NITs in the documentation from #6630

This commit is contained in:
xFrednet 2021-01-25 19:46:19 +01:00
parent c56b32899f
commit 69f2b8f0f8
2 changed files with 6 additions and 6 deletions

View File

@ -581,15 +581,15 @@ in the following steps:
3. Passing the configuration value to the lint impl struct:
First find the struct construction in the [clippy_lints lib file](/clippy_lints/src/lib.rs).
Make sure that `clippy dev update_lints` added it beforehand. The configuration value is now
cloned or copied into a local value that is then passed to the impl struct like this:
The configuration value is now cloned or copied into a local value that is then passed to the
impl struct like this:
```rust
// Default generated registration:
store.register_late_pass(|| box module::StructName);
store.register_*_pass(|| box module::StructName);
// New registration with configuration value
let configuration_ident = conf.configuration_ident.clone();
store.register_late_pass(move || box module::StructName::new(configuration_ident));
store.register_*_pass(move || box module::StructName::new(configuration_ident));
```
Congratulations the work is almost done. The configuration value can now be accessed
@ -599,7 +599,7 @@ in the following steps:
1. The default configured value can be tested like any normal lint in [`tests/ui`](/tests/ui).
2. The configuration itself will be tested separately in [`tests/ui-toml`](/tests/ui-toml).
Simply add a new subfolder with a fitting name. This folder contains a `clippy.toml` file
with the configuration value and a rust file that should be linted by clippy. The test can
with the configuration value and a rust file that should be linted by Clippy. The test can
otherwise be written as usual.
## Cheatsheet

View File

@ -109,7 +109,7 @@ See <https://rustc-dev-guide.rust-lang.org/contributing.html#opening-a-pr>.
| HIR | High-Level Intermediate Representation |
| TCX | Type context |
This is a concise list of abbreviations that can come up during clippy development. An extensive
This is a concise list of abbreviations that can come up during Clippy development. An extensive
general list can be found in the [rustc-dev-guide glossary][glossary]. Always feel free to ask if
an abbreviation or meaning is unclear to you.