crypto: Provide DerefMut on OwnUserIdentity and UserIdentity

This commit is contained in:
Andy Balaam
2024-09-20 16:02:11 +01:00
committed by Andy Balaam
parent c9fd5a0787
commit e85e50b185

View File

@@ -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 <Self as Deref>::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 <Self as Deref>::Target {
&mut self.inner
}
}
impl OtherUserIdentity {
/// Is this user identity verified.
pub fn is_verified(&self) -> bool {