We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61314a2 commit a961449Copy full SHA for a961449
src/socket.rs
@@ -1445,7 +1445,7 @@ impl Socket {
1445
target_os = "solaris",
1446
)))]
1447
pub fn set_recv_tos(&self, recv_tos: bool) -> io::Result<()> {
1448
- let recv_tos = if recv_tos { 1 } else { 0 };
+ let recv_tos = i32::from(recv_tos);
1449
1450
unsafe {
1451
setsockopt(
tests/socket.rs
@@ -1043,7 +1043,7 @@ fn cpu_affinity() {
1043
1044
// NOTE: This requires at least 2 CPU cores.
1045
let cpu = socket.cpu_affinity().unwrap();
1046
- let want = if cpu == 0 { 1 } else { 0 };
+ let want = usize::from(cpu == 0);
1047
1048
socket.set_cpu_affinity(want).unwrap();
1049
assert_eq!(socket.cpu_affinity().unwrap(), want);
0 commit comments