Merge commit '37f4fbb929' into clippy-subtree-update
This commit is contained in:
parent
6d674685ae
commit
4e6851e50b
291 changed files with 4890 additions and 5205 deletions
|
|
@ -458,9 +458,8 @@ pub struct ManualStrip {
|
|||
}
|
||||
|
||||
impl ManualStrip {
|
||||
#[must_use]
|
||||
pub fn new(msrv: Msrv) -> Self {
|
||||
Self { msrv }
|
||||
pub fn new(conf: &'static Conf) -> Self {
|
||||
Self { msrv: conf.msrv.clone() }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -689,7 +688,6 @@ for some users. Adding a configuration is done in the following steps:
|
|||
]);
|
||||
|
||||
// New manual definition struct
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct StructName {}
|
||||
|
||||
impl_lint_pass!(StructName => [
|
||||
|
|
@ -700,7 +698,6 @@ for some users. Adding a configuration is done in the following steps:
|
|||
2. Next add the configuration value and a corresponding creation method like
|
||||
this:
|
||||
```rust
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct StructName {
|
||||
configuration_ident: Type,
|
||||
}
|
||||
|
|
@ -708,9 +705,9 @@ for some users. Adding a configuration is done in the following steps:
|
|||
// ...
|
||||
|
||||
impl StructName {
|
||||
pub fn new(configuration_ident: Type) -> Self {
|
||||
pub fn new(conf: &'static Conf) -> Self {
|
||||
Self {
|
||||
configuration_ident,
|
||||
configuration_ident: conf.configuration_ident,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -726,8 +723,7 @@ for some users. Adding a configuration is done in the following steps:
|
|||
store.register_*_pass(|| box module::StructName);
|
||||
|
||||
// New registration with configuration value
|
||||
let configuration_ident = conf.configuration_ident.clone();
|
||||
store.register_*_pass(move || box module::StructName::new(configuration_ident));
|
||||
store.register_*_pass(move || box module::StructName::new(conf));
|
||||
```
|
||||
|
||||
Congratulations the work is almost done. The configuration value can now be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue