mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 21:52:30 -04:00
Fix double-clone
This commit is contained in:
committed by
Jonas Platte
parent
02449a73ea
commit
0e5d8bc904
@@ -343,9 +343,9 @@ impl Room {
|
||||
///
|
||||
/// [spec]: <https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room>
|
||||
pub async fn display_name(&self) -> StoreResult<DisplayName> {
|
||||
let cached = { &self.inner.read().unwrap().display_name.clone() };
|
||||
let cached = self.inner.read().unwrap().display_name.clone();
|
||||
if let Some(cached) = cached {
|
||||
Ok(cached.clone())
|
||||
Ok(cached)
|
||||
} else {
|
||||
self.calculate_name().await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user