Skip to content

Commit da4bd95

Browse files
committed
Elide redundant impl block lifetimes following stricter Rust 1.83 lint
Rust now points out that `impl<'a> (Trait for) Struct<'a>` is superfluous whenever `'a` is not used anywhere else in the `impl` block.
1 parent 7a4554c commit da4bd95

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

android-activity/src/game_activity/input.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pub(crate) struct PointerImpl<'a> {
263263
index: usize,
264264
}
265265

266-
impl<'a> PointerImpl<'a> {
266+
impl PointerImpl<'_> {
267267
#[inline]
268268
pub fn pointer_index(&self) -> usize {
269269
self.index
@@ -333,7 +333,7 @@ impl<'a> Iterator for PointersIterImpl<'a> {
333333
}
334334
}
335335

336-
impl<'a> ExactSizeIterator for PointersIterImpl<'a> {
336+
impl ExactSizeIterator for PointersIterImpl<'_> {
337337
fn len(&self) -> usize {
338338
self.count - self.next_index
339339
}
@@ -740,7 +740,7 @@ impl<'a> KeyEvent<'a> {
740740
}
741741
}
742742

743-
impl<'a> KeyEvent<'a> {
743+
impl KeyEvent<'_> {
744744
/// Flags associated with this [`KeyEvent`].
745745
///
746746
/// See [the NDK docs](https://developer.android.com/ndk/reference/group/input#akeyevent_getflags)

android-activity/src/game_activity/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<'a> StateSaver<'a> {
8484
pub struct StateLoader<'a> {
8585
app: &'a AndroidAppInner,
8686
}
87-
impl<'a> StateLoader<'a> {
87+
impl StateLoader<'_> {
8888
pub fn load(&self) -> Option<Vec<u8>> {
8989
unsafe {
9090
let app_ptr = self.app.native_app.as_ptr();
@@ -722,7 +722,7 @@ impl<'a> InputBuffer<'a> {
722722
}
723723
}
724724

725-
impl<'a> Drop for InputBuffer<'a> {
725+
impl Drop for InputBuffer<'_> {
726726
fn drop(&mut self) {
727727
unsafe {
728728
ffi::android_app_clear_motion_events(self.ptr.as_ptr());
@@ -801,7 +801,7 @@ pub(crate) struct InputIteratorInner<'a> {
801801
text_event_checked: bool,
802802
}
803803

804-
impl<'a> InputIteratorInner<'a> {
804+
impl InputIteratorInner<'_> {
805805
pub(crate) fn next<F>(&mut self, callback: F) -> bool
806806
where
807807
F: FnOnce(&input::InputEvent) -> InputStatus,
@@ -943,7 +943,7 @@ pub unsafe extern "C" fn _rust_glue_entry(native_app: *mut ffi::android_app) {
943943
// code to look up non-standard Java classes.
944944
android_main(app);
945945
})
946-
.unwrap_or_else(|panic| log_panic(panic));
946+
.unwrap_or_else(log_panic);
947947

948948
// Let JVM know that our Activity can be destroyed before detaching from the JVM
949949
//

android-activity/src/input.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ pub struct InputIterator<'a> {
912912
pub(crate) inner: crate::activity_impl::InputIteratorInner<'a>,
913913
}
914914

915-
impl<'a> InputIterator<'a> {
915+
impl InputIterator<'_> {
916916
/// Reads and handles the next input event by passing it to the given `callback`
917917
///
918918
/// `callback` should return [`InputStatus::Unhandled`] for any input events that aren't directly
@@ -932,7 +932,7 @@ pub struct Pointer<'a> {
932932
pub(crate) inner: PointerImpl<'a>,
933933
}
934934

935-
impl<'a> Pointer<'a> {
935+
impl Pointer<'_> {
936936
#[inline]
937937
pub fn pointer_index(&self) -> usize {
938938
self.inner.pointer_index()
@@ -1026,7 +1026,7 @@ impl<'a> Iterator for PointersIter<'a> {
10261026
}
10271027
}
10281028

1029-
impl<'a> ExactSizeIterator for PointersIter<'a> {
1029+
impl ExactSizeIterator for PointersIter<'_> {
10301030
fn len(&self) -> usize {
10311031
self.inner.len()
10321032
}

android-activity/src/native_activity/input.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct MotionEvent<'a> {
1515
ndk_event: ndk::event::MotionEvent,
1616
_lifetime: PhantomData<&'a ndk::event::MotionEvent>,
1717
}
18-
impl<'a> MotionEvent<'a> {
18+
impl MotionEvent<'_> {
1919
pub(crate) fn new(ndk_event: ndk::event::MotionEvent) -> Self {
2020
Self {
2121
ndk_event,
@@ -248,7 +248,7 @@ pub(crate) struct PointerImpl<'a> {
248248
ndk_pointer: ndk::event::Pointer<'a>,
249249
}
250250

251-
impl<'a> PointerImpl<'a> {
251+
impl PointerImpl<'_> {
252252
#[inline]
253253
pub fn pointer_index(&self) -> usize {
254254
self.ndk_pointer.pointer_index()
@@ -303,7 +303,7 @@ impl<'a> Iterator for PointersIterImpl<'a> {
303303
}
304304
}
305305

306-
impl<'a> ExactSizeIterator for PointersIterImpl<'a> {
306+
impl ExactSizeIterator for PointersIterImpl<'_> {
307307
fn len(&self) -> usize {
308308
self.ndk_pointers_iter.len()
309309
}
@@ -319,7 +319,7 @@ pub struct KeyEvent<'a> {
319319
ndk_event: ndk::event::KeyEvent,
320320
_lifetime: PhantomData<&'a ndk::event::KeyEvent>,
321321
}
322-
impl<'a> KeyEvent<'a> {
322+
impl KeyEvent<'_> {
323323
pub(crate) fn new(ndk_event: ndk::event::KeyEvent) -> Self {
324324
Self {
325325
ndk_event,

android-activity/src/native_activity/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<'a> StateSaver<'a> {
5353
pub struct StateLoader<'a> {
5454
app: &'a AndroidAppInner,
5555
}
56-
impl<'a> StateLoader<'a> {
56+
impl StateLoader<'_> {
5757
/// Returns whatever state was saved during the last [MainEvent::SaveState] event or `None`
5858
pub fn load(&self) -> Option<Vec<u8>> {
5959
self.app.native_activity.saved_state()
@@ -465,7 +465,7 @@ pub(crate) struct InputReceiver {
465465
queue: Option<InputQueue>,
466466
}
467467

468-
impl<'a> From<Arc<InputReceiver>> for InputIteratorInner<'a> {
468+
impl From<Arc<InputReceiver>> for InputIteratorInner<'_> {
469469
fn from(receiver: Arc<InputReceiver>) -> Self {
470470
Self {
471471
receiver,
@@ -480,7 +480,7 @@ pub(crate) struct InputIteratorInner<'a> {
480480
_lifetime: PhantomData<&'a ()>,
481481
}
482482

483-
impl<'a> InputIteratorInner<'a> {
483+
impl InputIteratorInner<'_> {
484484
pub(crate) fn next<F>(&self, callback: F) -> bool
485485
where
486486
F: FnOnce(&input::InputEvent) -> InputStatus,

0 commit comments

Comments
 (0)