We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4f1769 commit c58a5c6Copy full SHA for c58a5c6
clippy_lints/src/lifetimes.rs
@@ -24,9 +24,15 @@ declare_clippy_lint! {
24
///
25
/// **Example:**
26
/// ```rust
27
+ /// // Bad: unnecessary lifetime annotations
28
/// fn in_and_out<'a>(x: &'a u8, y: u8) -> &'a u8 {
29
/// x
30
/// }
31
+ ///
32
+ /// // Good
33
+ /// fn elided(x: &u8, y: u8) -> &u8 {
34
+ /// x
35
+ /// }
36
/// ```
37
pub NEEDLESS_LIFETIMES,
38
complexity,
@@ -46,9 +52,15 @@ declare_clippy_lint! {
46
52
47
53
48
54
55
+ /// // Bad: unnecessary lifetimes
49
56
/// fn unused_lifetime<'a>(x: u8) {
50
57
/// // ..
51
58
59
60
61
+ /// fn no_lifetime(x: u8) {
62
+ /// // ...
63
64
65
pub EXTRA_UNUSED_LIFETIMES,
66
0 commit comments