aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/syncmessage.rs
diff options
context:
space:
mode:
authorMax Audron <me@audron.dev>2026-02-21 13:32:00 +0100
committerMax Audron <me@audron.dev>2026-02-21 13:32:00 +0100
commit8882c121f83cf4513eaee7515d6dcea133a65d69 (patch)
treee2818c5d99f209159fd904e0c75d4bc30c262e82 /src/message/signalproxy/syncmessage.rs
parentremove old readme.org (diff)
replace all match_variant instances with try_into
the match_variant macro was unclear, unreadable and no longer needed as we have automaticly derived from implementations for all Variant enum fields now
Diffstat (limited to 'src/message/signalproxy/syncmessage.rs')
-rw-r--r--src/message/signalproxy/syncmessage.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/message/signalproxy/syncmessage.rs b/src/message/signalproxy/syncmessage.rs
index 94930af..bb61d7c 100644
--- a/src/message/signalproxy/syncmessage.rs
+++ b/src/message/signalproxy/syncmessage.rs
@@ -105,16 +105,18 @@ impl Serialize for SyncMessage {
impl Deserialize for SyncMessage {
fn parse(b: &[std::primitive::u8]) -> Result<(std::primitive::usize, Self), ProtocolError> {
- let (size, mut res) = VariantList::parse(&b)?;
+ let (size, mut res) = VariantList::parse(b)?;
res.remove(0);
+ let class_name: String = res.remove(0).try_into().unwrap();
+
Ok((
size,
Self {
- class_name: Class::from(match_variant!(res.remove(0), Variant::ByteArray)),
- object_name: match_variant!(res.remove(0), Variant::ByteArray),
- slot_name: match_variant!(res.remove(0), Variant::ByteArray),
+ class_name: Class::from(class_name),
+ object_name: res.remove(0).try_into().unwrap(),
+ slot_name: res.remove(0).try_into().unwrap(),
params: res,
},
))