Skip to content

Commit ac48d49

Browse files
committed
Simplified bool to int conversion
1 parent 50117af commit ac48d49

File tree

1 file changed

+1
-4
lines changed
  • library/std/src/sys/unix

1 file changed

+1
-4
lines changed

library/std/src/sys/unix/net.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,7 @@ impl Socket {
462462

463463
#[cfg(target_os = "vita")]
464464
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
465-
let option = match nonblocking {
466-
true => 1,
467-
false => 0,
468-
};
465+
let option = nonblocking as libc::c_int;
469466
setsockopt(self, libc::SOL_SOCKET, libc::SO_NONBLOCK, option)
470467
}
471468

0 commit comments

Comments
 (0)