1
Fork 0

Cast boolean into int directly in function set_passcred

This commit is contained in:
LinkTed 2020-09-17 11:32:20 +02:00
parent d0b133cdc6
commit e61148f98a

View file

@ -324,8 +324,7 @@ impl Socket {
}
pub fn set_passcred(&self, passcred: bool) -> io::Result<()> {
let boolean: libc::c_int = if passcred { 1 } else { 0 };
setsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED, boolean)
setsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED, passcred as libc::c_int)
}
pub fn passcred(&self) -> io::Result<bool> {