Loading libs/binder/rust/src/parcel.rs +7 −7 Original line number Diff line number Diff line Loading @@ -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() } Loading @@ -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) { Loading Loading @@ -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) Loading Loading @@ -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) Loading Loading @@ -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) Loading Loading @@ -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 Loading Loading @@ -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() } Loading libs/input/rust/keyboard_classifier.rs +4 −4 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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. Loading libs/nativewindow/rust/src/lib.rs +1 −1 Original line number Diff line number Diff line Loading @@ -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() Loading Loading
libs/binder/rust/src/parcel.rs +7 −7 Original line number Diff line number Diff line Loading @@ -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() } Loading @@ -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) { Loading Loading @@ -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) Loading Loading @@ -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) Loading Loading @@ -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) Loading Loading @@ -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 Loading Loading @@ -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() } Loading
libs/input/rust/keyboard_classifier.rs +4 −4 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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. Loading
libs/nativewindow/rust/src/lib.rs +1 −1 Original line number Diff line number Diff line Loading @@ -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() Loading