From e85e50b185c8ce5acf02dfd95accf969933bd501 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Fri, 20 Sep 2024 16:02:11 +0100 Subject: [PATCH] crypto: Provide DerefMut on OwnUserIdentity and UserIdentity --- crates/matrix-sdk-crypto/src/identities/user.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/matrix-sdk-crypto/src/identities/user.rs b/crates/matrix-sdk-crypto/src/identities/user.rs index 6a2e0b06f..44d68c3fb 100644 --- a/crates/matrix-sdk-crypto/src/identities/user.rs +++ b/crates/matrix-sdk-crypto/src/identities/user.rs @@ -14,7 +14,7 @@ use std::{ collections::HashMap, - ops::Deref, + ops::{Deref, DerefMut}, sync::{ atomic::{AtomicBool, Ordering}, Arc, RwLock, @@ -169,6 +169,12 @@ impl Deref for OwnUserIdentity { } } +impl DerefMut for OwnUserIdentity { + fn deref_mut(&mut self) -> &mut ::Target { + &mut self.inner + } +} + impl OwnUserIdentity { /// Mark our user identity as verified. /// @@ -282,6 +288,12 @@ impl Deref for OtherUserIdentity { } } +impl DerefMut for OtherUserIdentity { + fn deref_mut(&mut self) -> &mut ::Target { + &mut self.inner + } +} + impl OtherUserIdentity { /// Is this user identity verified. pub fn is_verified(&self) -> bool {