Skip to content

Commit

Permalink
fixup! feat(base): Introduce a DisplayName struct
Browse files Browse the repository at this point in the history
  • Loading branch information
poljar committed Nov 13, 2024
1 parent a309134 commit ff56095
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/matrix-sdk-base/src/deserialized_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ impl DisplayName {
/// return the original string provided during the construction of the
/// [`DisplayName`].
pub fn as_str(&self) -> &str {
self.decancered.as_ref().map(|d| d.as_str()).unwrap_or_else(|| &self.raw)
self.decancered.as_deref().unwrap_or_else(|| &self.raw)
}

/// Returns the underlying raw and and unsanitized string of this
/// [`DisplayName`].
pub fn raw_str(&self) -> &str {
self.decancered.as_ref().map(|d| d.as_str()).unwrap_or_else(|| &self.raw)
&self.raw
}

/// Returns the underlying normalized and and sanitized string of this
Expand Down

0 comments on commit ff56095

Please sign in to comment.