Skip to content

Commit 74758d2

Browse files
danielverkampcrosvm LUCI
authored and
crosvm LUCI
committed
[clippy] clean up redundant lifetimes for Windows
Fix a few more redundant lifetimes that were missed in https://crrev.comc/6195239 Change-Id: Ic664a1010866c6742b6cabfba78c41295645f33a Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6266470 Reviewed-by: Noah Gold <[email protected]> Commit-Queue: Daniel Verkamp <[email protected]>
1 parent 55e6639 commit 74758d2

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

base/src/sys/windows/async_wait_for_single_object.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ where
8888
}
8989
}
9090

91-
impl<'a, T> Future for WaitForHandle<'a, T>
91+
impl<T> Future for WaitForHandle<'_, T>
9292
where
9393
T: AsRawDescriptor,
9494
{
@@ -158,7 +158,7 @@ where
158158
}
159159
}
160160

161-
impl<'a, T> Drop for WaitForHandle<'a, T>
161+
impl<T> Drop for WaitForHandle<'_, T>
162162
where
163163
T: AsRawDescriptor,
164164
{

base/src/sys/windows/mmap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ pub trait MemoryMappingBuilderWindows<'a> {
156156
/// descriptor MUST be a mapping handle. Files MUST use `MemoryMappingBuilder::from_file`
157157
/// instead.
158158
#[allow(clippy::wrong_self_convention)]
159-
fn from_descriptor(self, descriptor: &'a dyn AsRawDescriptor) -> MemoryMappingBuilder;
159+
fn from_descriptor(self, descriptor: &'a dyn AsRawDescriptor) -> MemoryMappingBuilder<'a>;
160160
}
161161

162162
impl<'a> MemoryMappingBuilderWindows<'a> for MemoryMappingBuilder<'a> {
163163
/// See MemoryMappingBuilderWindows.
164-
fn from_descriptor(mut self, descriptor: &'a dyn AsRawDescriptor) -> MemoryMappingBuilder {
164+
fn from_descriptor(mut self, descriptor: &'a dyn AsRawDescriptor) -> MemoryMappingBuilder<'a> {
165165
self.descriptor = Some(descriptor);
166166
self
167167
}

base/src/sys/windows/multi_process_mutex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub struct MultiProcessMutexGuard<'a> {
9393
lock: &'a SafeDescriptor,
9494
}
9595

96-
impl<'a> Drop for MultiProcessMutexGuard<'a> {
96+
impl Drop for MultiProcessMutexGuard<'_> {
9797
fn drop(&mut self) {
9898
// SAFETY: We own the descriptor and is expected to be valid.
9999
if unsafe { ReleaseMutex(self.lock.as_raw_descriptor()) } == 0 {

net_util/src/slirp/sys/windows/handler.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl CallbackHandler for Handler {
192192
// The actual Timer is freed implicitly by the Box drop.
193193
}
194194

195-
fn get_timers<'a>(&'a self) -> Box<dyn Iterator<Item = &RawDescriptor> + 'a> {
195+
fn get_timers(&self) -> Box<dyn Iterator<Item = &RawDescriptor> + '_> {
196196
Box::new(self.timer_callbacks.keys())
197197
}
198198

@@ -377,7 +377,7 @@ struct EventSelectedSocket<'a> {
377377
}
378378

379379
impl<'a> EventSelectedSocket<'a> {
380-
fn new(socket: WSAPOLLFD, event: &'a Event) -> Result<EventSelectedSocket> {
380+
fn new(socket: WSAPOLLFD, event: &'a Event) -> Result<EventSelectedSocket<'a>> {
381381
// SAFETY:
382382
// Safe because socket.fd exists, the event handle is guaranteed to exist, and we check the
383383
// return code below.
@@ -397,7 +397,7 @@ impl<'a> EventSelectedSocket<'a> {
397397
}
398398
}
399399

400-
impl<'a> Drop for EventSelectedSocket<'a> {
400+
impl Drop for EventSelectedSocket<'_> {
401401
fn drop(&mut self) {
402402
// SAFETY:
403403
// Safe because socket.fd exists, the event handle is guaranteed to exist, and we check the

third_party/libslirp-rs/src/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub trait CallbackHandler {
126126

127127
/// Gets an iterator of timers (as raw descriptors) so they can be awaited with a suitable
128128
/// polling function as part of libslirp's main consumer loop.
129-
fn get_timers<'a>(&'a self) -> Box<dyn Iterator<Item = &RawDescriptor> + 'a>;
129+
fn get_timers(&self) -> Box<dyn Iterator<Item = &RawDescriptor> + '_>;
130130

131131
/// Runs the handler function for a specific timer.
132132
fn execute_timer(&mut self, timer: RawDescriptor);
@@ -694,7 +694,7 @@ impl<H: CallbackHandler> Context<H> {
694694
}
695695
}
696696

697-
pub fn get_timers<'a>(&'a self) -> Box<dyn Iterator<Item = &RawDescriptor> + 'a> {
697+
pub fn get_timers(&self) -> Box<dyn Iterator<Item = &RawDescriptor> + '_> {
698698
self.callback_handler.get_timers()
699699
}
700700

win_audio/src/win_audio_impl/wave_format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ fn upload_metrics(details: WaveFormatDetailsMetric, event_type: AudioFormatEvent
539539

540540
struct GuidWrapper<'a>(&'a GUID);
541541

542-
impl<'a> From<GuidWrapper<'a>> for WaveFormatSubFormatMetric {
542+
impl From<GuidWrapper<'_>> for WaveFormatSubFormatMetric {
543543
fn from(guid: GuidWrapper) -> WaveFormatSubFormatMetric {
544544
let guid = guid.0;
545545
if IsEqualGUID(guid, &KSDATAFORMAT_SUBTYPE_ANALOG) {

0 commit comments

Comments
 (0)