diff options
| author | Nikolay Arhipov <n@arhipov.net> | 2023-06-05 19:26:04 +0300 |
|---|---|---|
| committer | Nikolay Arhipov <n@arhipov.net> | 2023-06-05 19:26:04 +0300 |
| commit | ac48d49ff8c757ce8380b0ea0dc8048a841db192 (patch) | |
| tree | 9e6b8a26d548c62ff7cb7d2beaade1c30820f5f5 /library/std/src/sys/unix/net.rs | |
| parent | 50117af409ada03f7ee895c12e0009060f8ba4c1 (diff) | |
| download | rust-ac48d49ff8c757ce8380b0ea0dc8048a841db192.tar.gz rust-ac48d49ff8c757ce8380b0ea0dc8048a841db192.zip | |
Simplified bool to int conversion
Diffstat (limited to 'library/std/src/sys/unix/net.rs')
| -rw-r--r-- | library/std/src/sys/unix/net.rs | 5 |
1 files changed, 1 insertions, 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) } |
