From ac48d49ff8c757ce8380b0ea0dc8048a841db192 Mon Sep 17 00:00:00 2001 From: Nikolay Arhipov Date: Mon, 5 Jun 2023 19:26:04 +0300 Subject: [PATCH] Simplified bool to int conversion --- library/std/src/sys/unix/net.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/std/src/sys/unix/net.rs b/library/std/src/sys/unix/net.rs index ca80cabc3b0..7258c222a6c 100644 --- a/library/std/src/sys/unix/net.rs +++ b/library/std/src/sys/unix/net.rs @@ -462,10 +462,7 @@ impl Socket { #[cfg(target_os = "vita")] pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { - let option = match nonblocking { - true => 1, - false => 0, - }; + let option = nonblocking as libc::c_int; setsockopt(self, libc::SOL_SOCKET, libc::SO_NONBLOCK, option) }