task(base): Introduce UpdatedRoomDisplayName.

This patch introduces a new enum: `UpdatedRoomDisplayName`, which
will be used to know if a room display name is different or not when
computing the room display name.
This commit is contained in:
Ivan Enderlin
2025-04-15 15:44:01 +02:00
committed by Stefan Ceriu
parent bc50cae35f
commit adb7cd33d1

View File

@@ -66,6 +66,23 @@ pub enum RoomDisplayName {
Empty,
}
/// An internal representing whether a room display name is new or not when
/// computed.
pub(crate) enum UpdatedRoomDisplayName {
New(RoomDisplayName),
Same(RoomDisplayName),
}
impl UpdatedRoomDisplayName {
/// Get the inner [`RoomDisplayName`].
pub fn into_inner(self) -> RoomDisplayName {
match self {
UpdatedRoomDisplayName::New(room_display_name) => room_display_name,
UpdatedRoomDisplayName::Same(room_display_name) => room_display_name,
}
}
}
const WHITESPACE_REGEX: &str = r"\s+";
const INVALID_SYMBOLS_REGEX: &str = r"[#,:\{\}\\]+";