|
| 1 | +use std::borrow::Cow; |
1 | 2 | use std::collections::HashMap; |
2 | 3 | use std::str::FromStr; |
3 | 4 |
|
@@ -47,12 +48,12 @@ pub enum Irc { |
47 | 48 | React { |
48 | 49 | target: String, |
49 | 50 | msgid: message::Id, |
50 | | - text: String, |
| 51 | + text: Cow<'static, str>, |
51 | 52 | }, |
52 | 53 | Unreact { |
53 | 54 | target: String, |
54 | 55 | msgid: message::Id, |
55 | | - text: String, |
| 56 | + text: Cow<'static, str>, |
56 | 57 | }, |
57 | 58 | Me(String, String), |
58 | 59 | Whois(Option<String>, String), |
@@ -1263,12 +1264,12 @@ impl TryFrom<Irc> for proto::Message { |
1263 | 1264 | Irc::React { msgid, text, .. } => tags![ |
1264 | 1265 | "+reply" => msgid.to_string(), |
1265 | 1266 | "+draft/reply" => msgid.to_string(), |
1266 | | - "+draft/react" => text, |
| 1267 | + "+draft/react" => text.as_ref(), |
1267 | 1268 | ], |
1268 | 1269 | Irc::Unreact { msgid, text, .. } => tags![ |
1269 | 1270 | "+reply" => msgid.to_string(), |
1270 | 1271 | "+draft/reply" => msgid.to_string(), |
1271 | | - "+draft/unreact" => text, |
| 1272 | + "+draft/unreact" => text.as_ref(), |
1272 | 1273 | ], |
1273 | 1274 | Irc::Typing { value, .. } => tags!["+typing" => value.as_str()], |
1274 | 1275 | _ => tags![], |
|
0 commit comments