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/clientlogin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/message/handshake/clientlogin.rs') diff --git a/src/message/handshake/clientlogin.rs b/src/message/handshake/clientlogin.rs index c589810..b619e48 100644 --- a/src/message/handshake/clientlogin.rs +++ b/src/message/handshake/clientlogin.rs @@ -21,10 +21,10 @@ impl HandshakeSerialize for ClientLogin { } impl From for ClientLogin { - fn from(input: VariantMap) -> Self { + fn from(mut input: VariantMap) -> Self { ClientLogin { - user: match_variant!(input.get("User").unwrap(), Variant::String), - password: match_variant!(input.get("Password").unwrap(), Variant::String), + user: input.remove("User").unwrap().try_into().unwrap(), + password: input.remove("Password").unwrap().try_into().unwrap(), } } } -- cgit v1.2.3