Simplified bool to int conversion
This commit is contained in:
parent
50117af409
commit
ac48d49ff8
@ -462,10 +462,7 @@ pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
|
|||||||
|
|
||||||
#[cfg(target_os = "vita")]
|
#[cfg(target_os = "vita")]
|
||||||
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
|
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
|
||||||
let option = match nonblocking {
|
let option = nonblocking as libc::c_int;
|
||||||
true => 1,
|
|
||||||
false => 0,
|
|
||||||
};
|
|
||||||
setsockopt(self, libc::SOL_SOCKET, libc::SO_NONBLOCK, option)
|
setsockopt(self, libc::SOL_SOCKET, libc::SO_NONBLOCK, option)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user