Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit 7e07d89

Browse files
author
Alun Turner
committed
bit more type manipulation
1 parent 87b8a34 commit 7e07d89

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

crates/wysiwyg/src/dom/nodes/mention_node.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ pub enum MentionNodeKind<S>
3838
where
3939
S: UnicodeString,
4040
{
41-
Room { mention: Mention<S> },
42-
User { mention: Mention<S> },
41+
Room { mention: Mention },
42+
User { mention: Mention },
4343
MatrixUrl { display_text: S, url: S },
4444
AtRoom,
4545
}
@@ -81,8 +81,12 @@ where
8181
MentionNodeKind::MatrixUrl { display_text, .. } => {
8282
display_text.clone()
8383
}
84-
MentionNodeKind::User { mention } => mention.display_text().clone(),
85-
MentionNodeKind::Room { mention } => mention.display_text().clone(),
84+
MentionNodeKind::User { mention } => {
85+
S::from(mention.display_text())
86+
}
87+
MentionNodeKind::Room { mention } => {
88+
S::from(mention.display_text())
89+
}
8690
MentionNodeKind::AtRoom => S::from("@room"),
8791
}
8892
}
@@ -243,10 +247,10 @@ where
243247

244248
// There are two different functions to allow for fact one will use mxId later on
245249
match self.kind() {
246-
User => {
250+
User { .. } => {
247251
// TODO do something
248252
}
249-
Room => {
253+
Room { .. } => {
250254
// TODO do something
251255
}
252256
MatrixUrl { .. } => {

0 commit comments

Comments
 (0)