Skip to content

Commit ce5eac8

Browse files
committed
Remove the remaning unneeded lifetimes
clippy has started complainig about unneeded lifetimes, so remove them. Signed-off-by: Sergio Lopez <slp@redhat.com>
1 parent 34bc377 commit ce5eac8

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

src/devices/src/virtio/descriptor_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl<'a> Reader<'a> {
307307
}
308308
}
309309

310-
impl<'a> io::Read for Reader<'a> {
310+
impl io::Read for Reader<'_> {
311311
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
312312
self.buffer.consume(buf.len(), |bufs| {
313313
let mut rem = buf;
@@ -448,7 +448,7 @@ impl<'a> Writer<'a> {
448448
}
449449
}
450450

451-
impl<'a> io::Write for Writer<'a> {
451+
impl io::Write for Writer<'_> {
452452
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
453453
self.buffer.consume(buf.len(), |bufs| {
454454
let mut rem = buf;

src/devices/src/virtio/file_traits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait FileReadWriteVolatile {
9797
}
9898
}
9999

100-
impl<'a, T: FileReadWriteVolatile + ?Sized> FileReadWriteVolatile for &'a mut T {
100+
impl<T: FileReadWriteVolatile + ?Sized> FileReadWriteVolatile for &mut T {
101101
fn read_volatile(&mut self, slice: VolatileSlice) -> Result<usize> {
102102
(**self).read_volatile(slice)
103103
}
@@ -194,7 +194,7 @@ pub trait FileReadWriteAtVolatile {
194194
}
195195
}
196196

197-
impl<'a, T: FileReadWriteAtVolatile + ?Sized> FileReadWriteAtVolatile for &'a T {
197+
impl<T: FileReadWriteAtVolatile + ?Sized> FileReadWriteAtVolatile for &T {
198198
fn read_at_volatile(&self, slice: VolatileSlice, offset: u64) -> Result<usize> {
199199
(**self).read_at_volatile(slice, offset)
200200
}

src/devices/src/virtio/fs/filesystem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub trait ZeroCopyReader {
198198
}
199199
}
200200

201-
impl<'a, R: ZeroCopyReader> ZeroCopyReader for &'a mut R {
201+
impl<R: ZeroCopyReader> ZeroCopyReader for &mut R {
202202
fn read_to(&mut self, f: &File, count: usize, off: u64) -> io::Result<usize> {
203203
(**self).read_to(f, count, off)
204204
}
@@ -291,7 +291,7 @@ pub trait ZeroCopyWriter {
291291
}
292292
}
293293

294-
impl<'a, W: ZeroCopyWriter> ZeroCopyWriter for &'a mut W {
294+
impl<W: ZeroCopyWriter> ZeroCopyWriter for &mut W {
295295
fn write_from(&mut self, f: &File, count: usize, off: u64) -> io::Result<usize> {
296296
(**self).write_from(f, count, off)
297297
}

src/devices/src/virtio/fs/server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ const DIRENT_PADDING: [u8; 8] = [0; 8];
3434

3535
struct ZCReader<'a>(Reader<'a>);
3636

37-
impl<'a> ZeroCopyReader for ZCReader<'a> {
37+
impl ZeroCopyReader for ZCReader<'_> {
3838
fn read_to(&mut self, f: &File, count: usize, off: u64) -> io::Result<usize> {
3939
self.0.read_to_at(f, count, off)
4040
}
4141
}
4242

43-
impl<'a> io::Read for ZCReader<'a> {
43+
impl io::Read for ZCReader<'_> {
4444
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
4545
self.0.read(buf)
4646
}
4747
}
4848

4949
struct ZCWriter<'a>(Writer<'a>);
5050

51-
impl<'a> ZeroCopyWriter for ZCWriter<'a> {
51+
impl ZeroCopyWriter for ZCWriter<'_> {
5252
fn write_from(&mut self, f: &File, count: usize, off: u64) -> io::Result<usize> {
5353
self.0.write_from_at(f, count, off)
5454
}
5555
}
5656

57-
impl<'a> io::Write for ZCWriter<'a> {
57+
impl io::Write for ZCWriter<'_> {
5858
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
5959
self.0.write(buf)
6060
}

src/devices/src/virtio/queue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ unsafe impl ByteValued for VirtqUsedElem {}
151151

152152
/// An iterator over a single descriptor chain. Not to be confused with AvailIter,
153153
/// which iterates over the descriptor chain heads in a queue.
154-
155154
pub struct DescIter<'a> {
156155
next: Option<DescriptorChain<'a>>,
157156
}

0 commit comments

Comments
 (0)