Skip to content

Commit 13de9c3

Browse files
committed
Fix lifetime elision warnings
1 parent ad5ace9 commit 13de9c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/dma/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'rx, 'tx> EthernetDMA<'rx, 'tx> {
207207
/// If no packet is available, this function returns [`Err(RxError::WouldBlock)`](RxError::WouldBlock).
208208
///
209209
/// It may also return another kind of [`RxError`].
210-
pub fn recv_next(&mut self, packet_id: Option<PacketId>) -> Result<RxPacket, RxError> {
210+
pub fn recv_next(&'_ mut self, packet_id: Option<PacketId>) -> Result<RxPacket<'_>, RxError> {
211211
self.rx_ring.recv_next(packet_id.map(Into::into))
212212
}
213213

@@ -284,7 +284,7 @@ impl<'rx, 'tx> EthernetDMA<'rx, 'tx> {
284284
/// Receive a packet.
285285
///
286286
/// See [`RxRing::recv`].
287-
pub async fn recv(&mut self, packet_id: Option<PacketId>) -> RxPacket {
287+
pub async fn recv(&'_ mut self, packet_id: Option<PacketId>) -> RxPacket<'_> {
288288
self.rx_ring.recv(packet_id).await
289289
}
290290

src/dma/rx/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'a> RxRing<'a> {
160160

161161
/// Receive the next packet (if any is ready), or return [`Err`]
162162
/// immediately.
163-
pub fn recv_next(&mut self, packet_id: Option<PacketId>) -> Result<RxPacket, RxError> {
163+
pub fn recv_next(&'_ mut self, packet_id: Option<PacketId>) -> Result<RxPacket<'_>, RxError> {
164164
let (entry, length) = self.recv_next_impl(packet_id.map(|p| p.into()))?;
165165
Ok(RxPacket {
166166
entry: &mut self.entries[entry],
@@ -173,7 +173,7 @@ impl<'a> RxRing<'a> {
173173
/// The returned [`RxPacket`] can be used as a slice, and
174174
/// will contain the ethernet data.
175175
#[cfg(feature = "async-await")]
176-
pub async fn recv(&mut self, packet_id: Option<PacketId>) -> RxPacket {
176+
pub async fn recv(&'_ mut self, packet_id: Option<PacketId>) -> RxPacket<'_> {
177177
let (entry, length) = core::future::poll_fn(|ctx| {
178178
let res = self.recv_next_impl(packet_id.clone());
179179

0 commit comments

Comments
 (0)