Skip to content

Commit

Permalink
Fix clippy::needless_lifetimes warning
Browse files Browse the repository at this point in the history
Clippy nightly started warning e.g.:

```
warning: the following explicit lifetimes could be elided: 'conn
  --> x11rb-async/src/cookie.rs:68:6
   |
68 | impl<'conn, C: RequestConnection + ?Sized> Drop for VoidCookie<'conn, C> {
   |      ^^^^^                                                     ^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
   |
68 - impl<'conn, C: RequestConnection + ?Sized> Drop for VoidCookie<'conn, C> {
68 + impl<C: RequestConnection + ?Sized> Drop for VoidCookie<'_, C> {
   |
```

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed Nov 23, 2024
1 parent 45e688c commit 623d9d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x11rb-async/src/cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'conn, C: Connection + ?Sized> VoidCookie<'conn, C> {
}
}

impl<'conn, C: RequestConnection + ?Sized> Drop for VoidCookie<'conn, C> {
impl<C: RequestConnection + ?Sized> Drop for VoidCookie<'_, C> {
fn drop(&mut self) {
self.conn.discard_reply(
self.sequence,
Expand Down Expand Up @@ -94,7 +94,7 @@ impl<'a, C: RequestConnection + ?Sized> RawCookie<'a, C> {
}
}

impl<'a, C: RequestConnection + ?Sized> Drop for RawCookie<'a, C> {
impl<C: RequestConnection + ?Sized> Drop for RawCookie<'_, C> {
fn drop(&mut self) {
self.conn.discard_reply(
self.sequence,
Expand Down

0 comments on commit 623d9d3

Please sign in to comment.