]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/extra_unused_lifetimes.txt
Auto merge of #100865 - compiler-errors:parent-substs-still, r=cjgillot
[rust.git] / src / tools / clippy / src / docs / extra_unused_lifetimes.txt
1 ### What it does
2 Checks for lifetimes in generics that are never used
3 anywhere else.
4
5 ### Why is this bad?
6 The additional lifetimes make the code look more
7 complicated, while there is nothing out of the ordinary going on. Removing
8 them leads to more readable code.
9
10 ### Example
11 ```
12 // unnecessary lifetimes
13 fn unused_lifetime<'a>(x: u8) {
14     // ..
15 }
16 ```
17
18 Use instead:
19 ```
20 fn no_lifetime(x: u8) {
21     // ...
22 }
23 ```