diff options
author | 2025-01-16 15:01:29 -0800 | |
---|---|---|
committer | 2025-01-16 15:01:29 -0800 | |
commit | 6baae94f8751e9183f8a000e693596cdc95b6899 (patch) | |
tree | 49d6c0c5ecb5a539e5ad6fb92628678db3efd49f | |
parent | 24572ee08ff85c5951209a7ededfbfc7a995597a (diff) | |
parent | ad42d3212a1314c93f6f03d187114ec4d9f54137 (diff) |
Merge "Update Android for Rust 1.83.0" into main am: 9c4a66c26a am: ad42d3212a
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3454842
Change-Id: I9069530b734970f1208ca5d85040a2543aaace6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libs/binder/rust/src/parcel.rs | 14 | ||||
-rw-r--r-- | libs/input/rust/keyboard_classifier.rs | 8 | ||||
-rw-r--r-- | libs/nativewindow/rust/src/lib.rs | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/libs/binder/rust/src/parcel.rs b/libs/binder/rust/src/parcel.rs index 485b0bdb0d..2d40ced2fd 100644 --- a/libs/binder/rust/src/parcel.rs +++ b/libs/binder/rust/src/parcel.rs @@ -184,7 +184,7 @@ unsafe impl AsNative<sys::AParcel> for Parcel { /// Safety: The `BorrowedParcel` constructors guarantee that a `BorrowedParcel` /// object will always contain a valid pointer to an `AParcel`. -unsafe impl<'a> AsNative<sys::AParcel> for BorrowedParcel<'a> { +unsafe impl AsNative<sys::AParcel> for BorrowedParcel<'_> { fn as_native(&self) -> *const sys::AParcel { self.ptr.as_ptr() } @@ -195,7 +195,7 @@ unsafe impl<'a> AsNative<sys::AParcel> for BorrowedParcel<'a> { } // Data serialization methods -impl<'a> BorrowedParcel<'a> { +impl BorrowedParcel<'_> { /// Data written to parcelable is zero'd before being deleted or reallocated. #[cfg(not(android_ndk))] pub fn mark_sensitive(&mut self) { @@ -334,7 +334,7 @@ impl<'a> BorrowedParcel<'a> { /// A segment of a writable parcel, used for [`BorrowedParcel::sized_write`]. pub struct WritableSubParcel<'a>(BorrowedParcel<'a>); -impl<'a> WritableSubParcel<'a> { +impl WritableSubParcel<'_> { /// Write a type that implements [`Serialize`] to the sub-parcel. pub fn write<S: Serialize + ?Sized>(&mut self, parcelable: &S) -> Result<()> { parcelable.serialize(&mut self.0) @@ -440,7 +440,7 @@ impl Parcel { } // Data deserialization methods -impl<'a> BorrowedParcel<'a> { +impl BorrowedParcel<'_> { /// Attempt to read a type that implements [`Deserialize`] from this parcel. pub fn read<D: Deserialize>(&self) -> Result<D> { D::deserialize(self) @@ -565,7 +565,7 @@ pub struct ReadableSubParcel<'a> { end_position: i32, } -impl<'a> ReadableSubParcel<'a> { +impl ReadableSubParcel<'_> { /// Read a type that implements [`Deserialize`] from the sub-parcel. pub fn read<D: Deserialize>(&self) -> Result<D> { D::deserialize(&self.parcel) @@ -649,7 +649,7 @@ impl Parcel { } // Internal APIs -impl<'a> BorrowedParcel<'a> { +impl BorrowedParcel<'_> { pub(crate) fn write_binder(&mut self, binder: Option<&SpIBinder>) -> Result<()> { // Safety: `BorrowedParcel` always contains a valid pointer to an // `AParcel`. `AsNative` for `Option<SpIBinder`> will either return @@ -702,7 +702,7 @@ impl fmt::Debug for Parcel { } } -impl<'a> fmt::Debug for BorrowedParcel<'a> { +impl fmt::Debug for BorrowedParcel<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("BorrowedParcel").finish() } diff --git a/libs/input/rust/keyboard_classifier.rs b/libs/input/rust/keyboard_classifier.rs index 3c789b41e2..1b89a5cf2b 100644 --- a/libs/input/rust/keyboard_classifier.rs +++ b/libs/input/rust/keyboard_classifier.rs @@ -66,11 +66,11 @@ impl KeyboardClassifier { /// Get keyboard type for a tracked keyboard in KeyboardClassifier pub fn get_keyboard_type(&self, device_id: DeviceId) -> KeyboardType { - return if let Some(keyboard) = self.device_map.get(&device_id) { + if let Some(keyboard) = self.device_map.get(&device_id) { keyboard.keyboard_type } else { KeyboardType::None - }; + } } /// Tells if keyboard type classification is finalized. Once finalized the classification can't @@ -79,11 +79,11 @@ impl KeyboardClassifier { /// Finalized devices are either "alphabetic" keyboards or keyboards in blocklist or /// allowlist that are explicitly categorized and won't change with future key events pub fn is_finalized(&self, device_id: DeviceId) -> bool { - return if let Some(keyboard) = self.device_map.get(&device_id) { + if let Some(keyboard) = self.device_map.get(&device_id) { keyboard.is_finalized } else { false - }; + } } /// Process a key event and change keyboard type if required. diff --git a/libs/nativewindow/rust/src/lib.rs b/libs/nativewindow/rust/src/lib.rs index d760285918..aeb26031a5 100644 --- a/libs/nativewindow/rust/src/lib.rs +++ b/libs/nativewindow/rust/src/lib.rs @@ -541,7 +541,7 @@ pub struct HardwareBufferGuard<'a> { pub address: NonNull<c_void>, } -impl<'a> Drop for HardwareBufferGuard<'a> { +impl Drop for HardwareBufferGuard<'_> { fn drop(&mut self) { self.buffer .unlock() |