From d3dafa00aabc7d6637040fda021f5993509093fd Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Tue, 3 Mar 2026 12:05:46 +0200 Subject: [PATCH] Fix compile errors in fallback.rs We never hit this in CI because we either compile for windows, some sort of unix, or wasm. But we should at least have it compile. --- noq-udp/src/fallback.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/noq-udp/src/fallback.rs b/noq-udp/src/fallback.rs index 01a951e51..75986854d 100644 --- a/noq-udp/src/fallback.rs +++ b/noq-udp/src/fallback.rs @@ -1,5 +1,6 @@ use std::{ io::{self, IoSliceMut}, + num::NonZeroUsize, sync::Mutex, time::Instant, }; @@ -78,8 +79,8 @@ impl UdpSocketState { } #[inline] - pub fn max_gso_segments(&self) -> usize { - 1 + pub fn max_gso_segments(&self) -> NonZeroUsize { + NonZeroUsize::MIN } #[inline] @@ -121,7 +122,8 @@ fn send(socket: UdpSockRef<'_>, transmit: &Transmit<'_>) -> io::Result<()> { socket.0.send_to( transmit.contents, &socket2::SockAddr::from(transmit.destination), - ) + )?; + Ok(()) } pub(crate) const BATCH_SIZE: usize = 1;