diff --git a/libs/mpmc-channel/src/lib.rs b/libs/mpmc-channel/src/lib.rs index 6126364..7d0c51e 100644 --- a/libs/mpmc-channel/src/lib.rs +++ b/libs/mpmc-channel/src/lib.rs @@ -43,7 +43,7 @@ impl MPMC { } #[inline] - pub fn produce(&self) -> Producer { + pub fn produce(&self) -> Producer<'_, T> { let guard = self.inner.lock().unwrap(); Producer { cvar: &self.cvar, @@ -52,7 +52,7 @@ impl MPMC { } #[inline] - pub fn consume(&self) -> Consume { + pub fn consume(&self) -> Consume<'_, T> { let guard = self.inner.lock().unwrap(); Consume { cvar: &self.cvar, @@ -60,7 +60,7 @@ impl MPMC { } } - pub fn try_produce(&self) -> Result, WouldBlock> { + pub fn try_produce(&self) -> Result, WouldBlock> { let guard = match self.inner.try_lock() { Ok(val) => val, Err(TryLockError::WouldBlock) => return Err(WouldBlock), @@ -72,7 +72,7 @@ impl MPMC { }) } - pub fn try_consume(&self) -> Result, WouldBlock> { + pub fn try_consume(&self) -> Result, WouldBlock> { let guard = match self.inner.try_lock() { Ok(val) => val, Err(TryLockError::WouldBlock) => return Err(WouldBlock), diff --git a/src/net/tcp/split.rs b/src/net/tcp/split.rs index 6f1d8cb..6c54a31 100644 --- a/src/net/tcp/split.rs +++ b/src/net/tcp/split.rs @@ -21,7 +21,7 @@ pub struct WriteHalf<'a> { me: &'a TcpStream, } -pub fn split(stream: &mut TcpStream) -> (ReadHalf, WriteHalf) { +pub fn split(stream: &mut TcpStream) -> (ReadHalf<'_>, WriteHalf<'_>) { (ReadHalf { me: stream }, WriteHalf { me: stream }) } diff --git a/src/net/tcp/stream.rs b/src/net/tcp/stream.rs index 420501f..cb9326a 100644 --- a/src/net/tcp/stream.rs +++ b/src/net/tcp/stream.rs @@ -135,7 +135,7 @@ impl TcpStream { self.io.set_ttl(ttl) } - pub fn split(&mut self) -> (ReadHalf, WriteHalf) { + pub fn split(&mut self) -> (ReadHalf<'_>, WriteHalf<'_>) { split(self) } diff --git a/src/runtime/handle.rs b/src/runtime/handle.rs index 38488f2..6d5817f 100644 --- a/src/runtime/handle.rs +++ b/src/runtime/handle.rs @@ -55,7 +55,7 @@ impl Handle { crate::future::block_on(fut) } - pub fn enter(&self) -> EnterGuard { + pub fn enter(&self) -> EnterGuard<'_> { self.ctx.clone().init(); EnterGuard::new() } diff --git a/src/runtime/multithread/mod.rs b/src/runtime/multithread/mod.rs index 386df3e..a86d172 100644 --- a/src/runtime/multithread/mod.rs +++ b/src/runtime/multithread/mod.rs @@ -70,7 +70,7 @@ impl Runtime { &self.handle } - pub fn enter(&self) -> EnterGuard { + pub fn enter(&self) -> EnterGuard<'_> { self.handle.ctx.clone().init(); EnterGuard::new() }