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/handshake/clientinit.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/message/handshake/clientinit.rs') diff --git a/src/message/handshake/clientinit.rs b/src/message/handshake/clientinit.rs index 32e8595..94d52cf 100644 --- a/src/message/handshake/clientinit.rs +++ b/src/message/handshake/clientinit.rs @@ -64,12 +64,12 @@ impl HandshakeSerialize for ClientInit { } impl From for ClientInit { - fn from(input: VariantMap) -> Self { + fn from(mut input: VariantMap) -> Self { ClientInit { - client_version: match_variant!(input.get("ClientVersion").unwrap(), Variant::String), - client_date: match_variant!(input.get("ClientDate").unwrap(), Variant::String), - client_features: match_variant!(input.get("Features").unwrap(), Variant::u32), - feature_list: match_variant!(input.get("FeatureList").unwrap(), Variant::StringList), + client_version: input.remove("ClientVersion").unwrap().try_into().unwrap(), + client_date: input.remove("ClientDate").unwrap().try_into().unwrap(), + client_features: input.remove("Features").unwrap().try_into().unwrap(), + feature_list: input.remove("FeatureList").unwrap().try_into().unwrap(), } } } -- cgit v1.2.3