From 176583d1d4e9d2e0663e6ed51372432fd17aba4f Mon Sep 17 00:00:00 2001 From: Max Inden Date: Fri, 15 Mar 2024 19:07:28 +0100 Subject: [PATCH] refactor(udp): remove useless Socket::send return value `Socket::send` returns the number of `Datagram`s sent. Given that it only accepts a single `Datagram` to be send, this return value is at best useless and in the worst case confusing. --- neqo-bin/src/udp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neqo-bin/src/udp.rs b/neqo-bin/src/udp.rs index 632a1293d7..f4ede0b5c2 100644 --- a/neqo-bin/src/udp.rs +++ b/neqo-bin/src/udp.rs @@ -56,7 +56,7 @@ impl Socket { } /// Send the UDP datagram on the specified socket. - pub fn send(&self, d: Datagram) -> io::Result { + pub fn send(&self, d: Datagram) -> io::Result<()> { let transmit = Transmit { destination: d.destination(), ecn: EcnCodepoint::from_bits(Into::::into(d.tos())), @@ -72,7 +72,7 @@ impl Socket { assert_eq!(n, 1, "only passed one slice"); - Ok(n) + Ok(()) } /// Receive a UDP datagram on the specified socket.