diff --git a/src/devices/src/virtio/descriptor_utils.rs b/src/devices/src/virtio/descriptor_utils.rs index 8af40cec..a43e66f8 100644 --- a/src/devices/src/virtio/descriptor_utils.rs +++ b/src/devices/src/virtio/descriptor_utils.rs @@ -307,7 +307,7 @@ impl<'a> Reader<'a> { } } -impl<'a> io::Read for Reader<'a> { +impl io::Read for Reader<'_> { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.buffer.consume(buf.len(), |bufs| { let mut rem = buf; @@ -448,7 +448,7 @@ impl<'a> Writer<'a> { } } -impl<'a> io::Write for Writer<'a> { +impl io::Write for Writer<'_> { fn write(&mut self, buf: &[u8]) -> io::Result { self.buffer.consume(buf.len(), |bufs| { let mut rem = buf; diff --git a/src/devices/src/virtio/file_traits.rs b/src/devices/src/virtio/file_traits.rs index 2e13eb67..72ab0e31 100644 --- a/src/devices/src/virtio/file_traits.rs +++ b/src/devices/src/virtio/file_traits.rs @@ -97,7 +97,7 @@ pub trait FileReadWriteVolatile { } } -impl<'a, T: FileReadWriteVolatile + ?Sized> FileReadWriteVolatile for &'a mut T { +impl FileReadWriteVolatile for &mut T { fn read_volatile(&mut self, slice: VolatileSlice) -> Result { (**self).read_volatile(slice) } @@ -194,7 +194,7 @@ pub trait FileReadWriteAtVolatile { } } -impl<'a, T: FileReadWriteAtVolatile + ?Sized> FileReadWriteAtVolatile for &'a T { +impl FileReadWriteAtVolatile for &T { fn read_at_volatile(&self, slice: VolatileSlice, offset: u64) -> Result { (**self).read_at_volatile(slice, offset) } diff --git a/src/devices/src/virtio/fs/filesystem.rs b/src/devices/src/virtio/fs/filesystem.rs index 4d032cf8..ed1284d8 100644 --- a/src/devices/src/virtio/fs/filesystem.rs +++ b/src/devices/src/virtio/fs/filesystem.rs @@ -198,7 +198,7 @@ pub trait ZeroCopyReader { } } -impl<'a, R: ZeroCopyReader> ZeroCopyReader for &'a mut R { +impl ZeroCopyReader for &mut R { fn read_to(&mut self, f: &File, count: usize, off: u64) -> io::Result { (**self).read_to(f, count, off) } @@ -291,7 +291,7 @@ pub trait ZeroCopyWriter { } } -impl<'a, W: ZeroCopyWriter> ZeroCopyWriter for &'a mut W { +impl ZeroCopyWriter for &mut W { fn write_from(&mut self, f: &File, count: usize, off: u64) -> io::Result { (**self).write_from(f, count, off) } diff --git a/src/devices/src/virtio/fs/server.rs b/src/devices/src/virtio/fs/server.rs index 5efb1f3b..b477a099 100644 --- a/src/devices/src/virtio/fs/server.rs +++ b/src/devices/src/virtio/fs/server.rs @@ -34,13 +34,13 @@ const DIRENT_PADDING: [u8; 8] = [0; 8]; struct ZCReader<'a>(Reader<'a>); -impl<'a> ZeroCopyReader for ZCReader<'a> { +impl ZeroCopyReader for ZCReader<'_> { fn read_to(&mut self, f: &File, count: usize, off: u64) -> io::Result { self.0.read_to_at(f, count, off) } } -impl<'a> io::Read for ZCReader<'a> { +impl io::Read for ZCReader<'_> { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.0.read(buf) } @@ -48,13 +48,13 @@ impl<'a> io::Read for ZCReader<'a> { struct ZCWriter<'a>(Writer<'a>); -impl<'a> ZeroCopyWriter for ZCWriter<'a> { +impl ZeroCopyWriter for ZCWriter<'_> { fn write_from(&mut self, f: &File, count: usize, off: u64) -> io::Result { self.0.write_from_at(f, count, off) } } -impl<'a> io::Write for ZCWriter<'a> { +impl io::Write for ZCWriter<'_> { fn write(&mut self, buf: &[u8]) -> io::Result { self.0.write(buf) } diff --git a/src/devices/src/virtio/queue.rs b/src/devices/src/virtio/queue.rs index 954d415f..a0bdc04a 100644 --- a/src/devices/src/virtio/queue.rs +++ b/src/devices/src/virtio/queue.rs @@ -151,7 +151,6 @@ unsafe impl ByteValued for VirtqUsedElem {} /// An iterator over a single descriptor chain. Not to be confused with AvailIter, /// which iterates over the descriptor chain heads in a queue. - pub struct DescIter<'a> { next: Option>, }