diff options
| author | 2023-06-22 15:53:38 +0000 | |
|---|---|---|
| committer | 2023-06-22 15:53:38 +0000 | |
| commit | 48cfae79ea9e6e976c23599013e98842dbd01369 (patch) | |
| tree | 21255d091263b78af7e8237d764a9eef2a614a39 | |
| parent | 0206fed4ebbd9f1554a412a4c4857a499f10f0fb (diff) | |
| parent | 64b5bc46af590fb1fb7131aad94d4afa901d8c38 (diff) | |
Merge "Implement the clone trait for ParcelableHolder"
| -rw-r--r-- | libs/binder/rust/src/parcel/parcelable_holder.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/binder/rust/src/parcel/parcelable_holder.rs b/libs/binder/rust/src/parcel/parcelable_holder.rs index 383cc83509..eb82fb7fd6 100644 --- a/libs/binder/rust/src/parcel/parcelable_holder.rs +++ b/libs/binder/rust/src/parcel/parcelable_holder.rs @@ -161,6 +161,15 @@ impl ParcelableHolder { } } +impl Clone for ParcelableHolder { + fn clone(&self) -> ParcelableHolder { + ParcelableHolder { + data: Mutex::new(self.data.lock().unwrap().clone()), + stability: self.stability, + } + } +} + impl Serialize for ParcelableHolder { fn serialize(&self, parcel: &mut BorrowedParcel<'_>) -> Result<(), StatusCode> { parcel.write(&NON_NULL_PARCELABLE_FLAG)?; |