From e6a335b93a10620bcb7cbfa32e232949758f0c99 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 21 Sep 2021 10:23:04 +0300 Subject: Drop unnecessary lifetime notations Rust can automatically deduce lifetimes in some cases ("lifetime elision"). While adding unnecessary lifetime annotations is not incorrect, it can make it harder to follow the code: why is there a lifetime annotation here? What is the reason why it's needed? Is something unusual going on. This removes a few unnecessary lifetime annotations, as found by the clippy lint needless_lifetimes: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes --- ipc/src/assuan/mod.rs | 2 +- ipc/src/gnupg.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ipc') diff --git a/ipc/src/assuan/mod.rs b/ipc/src/assuan/mod.rs index 9f7ab824..5a4d9f20 100644 --- a/ipc/src/assuan/mod.rs +++ b/ipc/src/assuan/mod.rs @@ -138,7 +138,7 @@ impl Client { /// using this objects [`Stream`] implementation. /// /// [`Stream`]: #impl-Stream - pub fn cancel<'a>(&'a mut self) -> Result<()> { + pub fn cancel(&mut self) -> Result<()> { self.send("CAN") } diff --git a/ipc/src/gnupg.rs b/ipc/src/gnupg.rs index f008d012..68906829 100644 --- a/ipc/src/gnupg.rs +++ b/ipc/src/gnupg.rs @@ -324,7 +324,7 @@ impl Agent { /// Note: This function does not try to start the server. If no /// server is running for the given context, this operation will /// fail. - pub async fn connect<'c>(ctx: &'c Context) -> Result { + pub async fn connect(ctx: &Context) -> Result { let path = ctx.socket("agent")?; Self::connect_to(path).await } -- cgit v1.2.3