From 4513bc7955a4870cae65798599f87d1c7eaca0b5 Mon Sep 17 00:00:00 2001 From: EAimTY Date: Tue, 30 May 2023 20:45:40 +0900 Subject: [PATCH] better code readability --- tuic/src/protocol/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tuic/src/protocol/mod.rs b/tuic/src/protocol/mod.rs index 6dcc2fd..5cc78ee 100644 --- a/tuic/src/protocol/mod.rs +++ b/tuic/src/protocol/mod.rs @@ -142,10 +142,8 @@ impl Address { 1 + match self { Address::None => 0, Address::DomainAddress(addr, _) => 1 + addr.len() + 2, - Address::SocketAddress(addr) => match addr { - SocketAddr::V4(_) => 4 + 2, - SocketAddr::V6(_) => 2 * 8 + 2, - }, + Address::SocketAddress(SocketAddr::V4(_)) => 4 + 2, + Address::SocketAddress(SocketAddr::V6(_)) => 16 + 2, } }