Skip to content

Commit 1c67209

Browse files
aym-vThomasdezeeuw
authored andcommitted
use the as_raw method
1 parent a7c82f7 commit 1c67209

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ impl Socket {
11821182
target_os = "illumos",
11831183
)))]
11841184
pub fn set_tos(&self, tos: u32) -> io::Result<()> {
1185-
unsafe { setsockopt(self.inner, sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) }
1185+
unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) }
11861186
}
11871187

11881188
/// Get the value of the `IP_TOS` option for this socket.
@@ -1200,7 +1200,7 @@ impl Socket {
12001200
)))]
12011201
pub fn tos(&self) -> io::Result<u32> {
12021202
unsafe {
1203-
getsockopt::<c_int>(self.inner, sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32)
1203+
getsockopt::<c_int>(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32)
12041204
}
12051205
}
12061206
}

0 commit comments

Comments
 (0)