From 8882c121f83cf4513eaee7515d6dcea133a65d69 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sat, 21 Feb 2026 13:32:00 +0100 Subject: 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 --- src/message/signalproxy/syncmessage.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/message/signalproxy/syncmessage.rs') 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, }, )) -- cgit v1.2.3