mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-08 07:56:55 -04:00
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:
committed by
Stefan Ceriu
parent
bc50cae35f
commit
adb7cd33d1
@@ -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"[#,:\{\}\\]+";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user