Skip to content

Commit 8fa7c0b

Browse files
committed
Remove unnecessary unsafe block
1 parent 826d6c2 commit 8fa7c0b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/sys/unix.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ impl crate::Socket {
14391439
}
14401440

14411441
/// Set the value of the `TCP_THIN_LINEAR_TIMEOUTS` option on this socket.
1442-
///
1442+
///
14431443
/// If set, the kernel will dynamically detect a thin-stream connection if there are less than four packets in flight.
14441444
/// With less than four packets in flight the normal TCP fast retransmission will not be effective.
14451445
/// The kernel will modify the retransmission to avoid the very high latencies that thin stream suffer because of exponential backoff.
@@ -1484,15 +1484,13 @@ impl crate::Socket {
14841484
let mut buf: [MaybeUninit<u8>; libc::IFNAMSIZ] =
14851485
unsafe { MaybeUninit::uninit().assume_init() };
14861486
let mut len = buf.len() as libc::socklen_t;
1487-
unsafe {
1488-
syscall!(getsockopt(
1489-
self.as_raw(),
1490-
libc::SOL_SOCKET,
1491-
libc::SO_BINDTODEVICE,
1492-
buf.as_mut_ptr().cast(),
1493-
&mut len,
1494-
))?;
1495-
}
1487+
syscall!(getsockopt(
1488+
self.as_raw(),
1489+
libc::SOL_SOCKET,
1490+
libc::SO_BINDTODEVICE,
1491+
buf.as_mut_ptr().cast(),
1492+
&mut len,
1493+
))?;
14961494
if len == 0 {
14971495
Ok(None)
14981496
} else {

0 commit comments

Comments
 (0)