Skip to content

Commit d158435

Browse files
committed
Remove unused fields from TcpKeepalive
Not all OSs support all options, remove the field on OSs that don't support it.
1 parent ee55900 commit d158435

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ impl<'a> DerefMut for MaybeUninitSlice<'a> {
326326
#[derive(Debug, Clone)]
327327
pub struct TcpKeepalive {
328328
time: Option<Duration>,
329-
#[cfg_attr(target_os = "redox", allow(dead_code))]
329+
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
330330
interval: Option<Duration>,
331-
#[cfg_attr(target_os = "redox", allow(dead_code))]
331+
#[cfg(not(any(target_os = "redox", target_os = "solaris", target_os = "windows")))]
332332
retries: Option<u32>,
333333
}
334334

@@ -337,7 +337,9 @@ impl TcpKeepalive {
337337
pub const fn new() -> TcpKeepalive {
338338
TcpKeepalive {
339339
time: None,
340+
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
340341
interval: None,
342+
#[cfg(not(any(target_os = "redox", target_os = "solaris", target_os = "windows")))]
341343
retries: None,
342344
}
343345
}

0 commit comments

Comments
 (0)