Skip to content

Commit 9c4a66c

Browse files
Treehugger RobotGerrit Code Review
authored andcommitted
Merge "Update Android for Rust 1.83.0" into main
2 parents 12a57e3 + ca8d45a commit 9c4a66c

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

libs/binder/rust/src/parcel.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ unsafe impl AsNative<sys::AParcel> for Parcel {
184184

185185
/// Safety: The `BorrowedParcel` constructors guarantee that a `BorrowedParcel`
186186
/// object will always contain a valid pointer to an `AParcel`.
187-
unsafe impl<'a> AsNative<sys::AParcel> for BorrowedParcel<'a> {
187+
unsafe impl AsNative<sys::AParcel> for BorrowedParcel<'_> {
188188
fn as_native(&self) -> *const sys::AParcel {
189189
self.ptr.as_ptr()
190190
}
@@ -195,7 +195,7 @@ unsafe impl<'a> AsNative<sys::AParcel> for BorrowedParcel<'a> {
195195
}
196196

197197
// Data serialization methods
198-
impl<'a> BorrowedParcel<'a> {
198+
impl BorrowedParcel<'_> {
199199
/// Data written to parcelable is zero'd before being deleted or reallocated.
200200
#[cfg(not(android_ndk))]
201201
pub fn mark_sensitive(&mut self) {
@@ -334,7 +334,7 @@ impl<'a> BorrowedParcel<'a> {
334334
/// A segment of a writable parcel, used for [`BorrowedParcel::sized_write`].
335335
pub struct WritableSubParcel<'a>(BorrowedParcel<'a>);
336336

337-
impl<'a> WritableSubParcel<'a> {
337+
impl WritableSubParcel<'_> {
338338
/// Write a type that implements [`Serialize`] to the sub-parcel.
339339
pub fn write<S: Serialize + ?Sized>(&mut self, parcelable: &S) -> Result<()> {
340340
parcelable.serialize(&mut self.0)
@@ -440,7 +440,7 @@ impl Parcel {
440440
}
441441

442442
// Data deserialization methods
443-
impl<'a> BorrowedParcel<'a> {
443+
impl BorrowedParcel<'_> {
444444
/// Attempt to read a type that implements [`Deserialize`] from this parcel.
445445
pub fn read<D: Deserialize>(&self) -> Result<D> {
446446
D::deserialize(self)
@@ -565,7 +565,7 @@ pub struct ReadableSubParcel<'a> {
565565
end_position: i32,
566566
}
567567

568-
impl<'a> ReadableSubParcel<'a> {
568+
impl ReadableSubParcel<'_> {
569569
/// Read a type that implements [`Deserialize`] from the sub-parcel.
570570
pub fn read<D: Deserialize>(&self) -> Result<D> {
571571
D::deserialize(&self.parcel)
@@ -649,7 +649,7 @@ impl Parcel {
649649
}
650650

651651
// Internal APIs
652-
impl<'a> BorrowedParcel<'a> {
652+
impl BorrowedParcel<'_> {
653653
pub(crate) fn write_binder(&mut self, binder: Option<&SpIBinder>) -> Result<()> {
654654
// Safety: `BorrowedParcel` always contains a valid pointer to an
655655
// `AParcel`. `AsNative` for `Option<SpIBinder`> will either return
@@ -702,7 +702,7 @@ impl fmt::Debug for Parcel {
702702
}
703703
}
704704

705-
impl<'a> fmt::Debug for BorrowedParcel<'a> {
705+
impl fmt::Debug for BorrowedParcel<'_> {
706706
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
707707
f.debug_struct("BorrowedParcel").finish()
708708
}

libs/input/rust/keyboard_classifier.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ impl KeyboardClassifier {
6666

6767
/// Get keyboard type for a tracked keyboard in KeyboardClassifier
6868
pub fn get_keyboard_type(&self, device_id: DeviceId) -> KeyboardType {
69-
return if let Some(keyboard) = self.device_map.get(&device_id) {
69+
if let Some(keyboard) = self.device_map.get(&device_id) {
7070
keyboard.keyboard_type
7171
} else {
7272
KeyboardType::None
73-
};
73+
}
7474
}
7575

7676
/// Tells if keyboard type classification is finalized. Once finalized the classification can't
@@ -79,11 +79,11 @@ impl KeyboardClassifier {
7979
/// Finalized devices are either "alphabetic" keyboards or keyboards in blocklist or
8080
/// allowlist that are explicitly categorized and won't change with future key events
8181
pub fn is_finalized(&self, device_id: DeviceId) -> bool {
82-
return if let Some(keyboard) = self.device_map.get(&device_id) {
82+
if let Some(keyboard) = self.device_map.get(&device_id) {
8383
keyboard.is_finalized
8484
} else {
8585
false
86-
};
86+
}
8787
}
8888

8989
/// Process a key event and change keyboard type if required.

libs/nativewindow/rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ pub struct HardwareBufferGuard<'a> {
541541
pub address: NonNull<c_void>,
542542
}
543543

544-
impl<'a> Drop for HardwareBufferGuard<'a> {
544+
impl Drop for HardwareBufferGuard<'_> {
545545
fn drop(&mut self) {
546546
self.buffer
547547
.unlock()

0 commit comments

Comments
 (0)