Skip to content

Commit 5110aa6

Browse files
committed
doc(base): update lying doc comment of compute_display_name
It claimed that it would immediately return when the cached display name value was computed, but that's absolutely not the case. Spotted while reviewing a PR updating `iamb` to the latest version of the SDK.
1 parent bcad0a3 commit 5110aa6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/matrix-sdk-base/src/rooms/normal.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,15 @@ impl Room {
623623
self.inner.read().active_room_call_participants()
624624
}
625625

626-
/// Return the cached display name of the room if it was provided via sync,
627-
/// or otherwise calculate it, taking into account its name, aliases and
628-
/// members.
626+
/// Calculate a room's display name, taking into account its name, aliases
627+
/// and members.
629628
///
630629
/// The display name is calculated according to [this algorithm][spec].
631630
///
632-
/// This is automatically recomputed on every successful sync, and the
633-
/// cached result can be retrieved in
634-
/// [`Self::cached_display_name`].
631+
/// ⚠ This may be slowish to compute. As such, the result is cached and can
632+
/// be retrieved via [`Room::cached_display_name`], which should be
633+
/// preferred in general. Indeed, the cached value is automatically
634+
/// recomputed on every sync.
635635
///
636636
/// [spec]: <https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room>
637637
pub async fn compute_display_name(&self) -> StoreResult<RoomDisplayName> {

0 commit comments

Comments
 (0)