Skip to content

Commit

Permalink
chore: Define the lifetime of some const strings explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
poljar committed Nov 28, 2024
1 parent daa984f commit e1f0037
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/matrix-sdk-base/src/deserialized_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ impl PartialEq for DisplayName {

impl DisplayName {
/// Regex pattern matching an MXID.
const MXID_PATTERN: &str = "@.+[:.].+";
const MXID_PATTERN: &'static str = "@.+[:.].+";

/// Regex pattern matching some left-to-right formatting marks:
/// * LTR and RTL marks U+200E and U+200F
/// * LTR/RTL and other directional formatting marks U+202A - U+202F
const LEFT_TO_RIGHT_PATTERN: &str = "[\u{202a}-\u{202f}\u{200e}\u{200f}]";
const LEFT_TO_RIGHT_PATTERN: &'static str = "[\u{202a}-\u{202f}\u{200e}\u{200f}]";

/// Regex pattern matching bunch of unicode control characters and otherwise
/// misleading/invisible characters.
Expand All @@ -176,7 +176,7 @@ impl DisplayName {
/// * Blank/invisible characters (U2800, U2062-U2063)
/// * Arabic Letter RTL mark U+061C
/// * Zero width no-break space (BOM) U+FEFF
const HIDDEN_CHARACTERS_PATTERN: &str =
const HIDDEN_CHARACTERS_PATTERN: &'static str =
"[\u{2000}-\u{200D}\u{300}-\u{036f}\u{2062}-\u{2063}\u{2800}\u{061c}\u{feff}]";

/// Creates a new [`DisplayName`] from the given raw string.
Expand Down

0 comments on commit e1f0037

Please sign in to comment.