From fd33e75fd1c17536631ba92054b5e1d37a3ca56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 13 Nov 2024 09:35:24 +0100 Subject: [PATCH] fixup! feat(base): Introduce a DisplayName struct --- crates/matrix-sdk-base/src/deserialized_responses.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/matrix-sdk-base/src/deserialized_responses.rs b/crates/matrix-sdk-base/src/deserialized_responses.rs index bce9a98eb95..4e477d929df 100644 --- a/crates/matrix-sdk-base/src/deserialized_responses.rs +++ b/crates/matrix-sdk-base/src/deserialized_responses.rs @@ -211,7 +211,7 @@ impl DisplayName { /// Returns `None` if normalization failed during construction of this /// [`DisplayName`]. pub fn as_normalized_str(&self) -> Option<&str> { - self.decancered.as_ref().map(|d| d.as_str()) + self.decancered.as_deref() } fn has_cancer(&self) -> bool { @@ -219,8 +219,8 @@ impl DisplayName { // the same as the raw display name, then we're cancer free. let cancer_free = self .decancered - .as_ref() - .is_some_and(|decancered| decancered.as_str() == self.raw.to_lowercase()); + .as_deref() + .is_some_and(|decancered| decancered == self.raw.to_lowercase()); !cancer_free }