Skip to content

Commit d66e9e8

Browse files
Fix unused code warnings
Co-authored-by: Thomas de Zeeuw <[email protected]>
1 parent c2e56f4 commit d66e9e8

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/sys/shell/selector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Selector {
2121
}
2222

2323
#[cfg(unix)]
24-
cfg_any_os_ext! {
24+
cfg_os_ext! {
2525
use crate::{Interest, Token};
2626

2727
impl Selector {
@@ -40,7 +40,7 @@ cfg_any_os_ext! {
4040
}
4141

4242
#[cfg(target_os = "wasi")]
43-
cfg_any_os_ext! {
43+
cfg_os_ext! {
4444
use crate::{Interest, Token};
4545

4646
impl Selector {

src/sys/unix/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ cfg_os_poll! {
108108
// NOTE: the `Waker` type is expected in the selector module as the
109109
// `poll(2)` implementation needs to do some special stuff.
110110

111+
#[cfg(feature = "os-ext")]
111112
mod sourcefd;
112113
#[cfg(feature = "os-ext")]
113114
pub use self::sourcefd::SourceFd;
@@ -159,9 +160,8 @@ cfg_os_poll! {
159160
}
160161

161162
cfg_not_os_poll! {
162-
cfg_any_os_ext! {
163+
cfg_os_ext! {
163164
mod sourcefd;
164-
#[cfg(feature = "os-ext")]
165165
pub use self::sourcefd::SourceFd;
166166
}
167167
}

src/sys/unix/selector/epoll.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
use std::io;
12
use std::os::fd::{AsRawFd, FromRawFd, OwnedFd, RawFd};
23
#[cfg(debug_assertions)]
34
use std::sync::atomic::{AtomicUsize, Ordering};
45
use std::time::Duration;
5-
use std::{io, ptr};
6+
7+
cfg_io_source! {
8+
use std::ptr;
9+
}
610

711
use libc::{EPOLLET, EPOLLIN, EPOLLOUT, EPOLLPRI, EPOLLRDHUP};
812

@@ -78,6 +82,7 @@ impl Selector {
7882
syscall!(epoll_ctl(ep, libc::EPOLL_CTL_ADD, fd, &mut event)).map(|_| ())
7983
}
8084

85+
cfg_io_source! {
8186
pub fn reregister(&self, fd: RawFd, token: Token, interests: Interest) -> io::Result<()> {
8287
let mut event = libc::epoll_event {
8388
events: interests_to_epoll(interests),
@@ -94,6 +99,7 @@ impl Selector {
9499
let ep = self.ep.as_raw_fd();
95100
syscall!(epoll_ctl(ep, libc::EPOLL_CTL_DEL, fd, ptr::null_mut())).map(|_| ())
96101
}
102+
}
97103
}
98104

99105
cfg_io_source! {

0 commit comments

Comments
 (0)