From 4c184a30a2e7f8cd81d4f88fb0530302eafe9568 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Wed, 10 Jun 2020 00:28:56 +0200 Subject: [PATCH] Add doc comment to RoomName::calculate_name. --- matrix_sdk_base/src/models/room.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/matrix_sdk_base/src/models/room.rs b/matrix_sdk_base/src/models/room.rs index 5cf61820..523d15ac 100644 --- a/matrix_sdk_base/src/models/room.rs +++ b/matrix_sdk_base/src/models/room.rs @@ -201,9 +201,14 @@ impl RoomName { true } + /// Calculate the canonical display name of a room, taking into account its name, aliases and + /// members. + /// + /// The display name is calculated according to [this algorithm][spec]. + /// + /// [spec]: + /// pub fn calculate_name(&self, members: &HashMap) -> String { - // https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room. - // the order in which we check for a name ^^ if let Some(name) = &self.name { let name = name.trim(); name.to_string()