Skip to content

Commit 069126d

Browse files
committed
Fix windows build error
1 parent 397009e commit 069126d

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

src/reactor/registration.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
mod impl_ {
33
use polling::{Event, Poller};
44
use std::io::Result;
5-
use std::os::windows::io::{AsRawSocket, RawSocket};
5+
use std::os::windows::io::RawSocket;
66

77
/// The raw registration into the reactor.
88
#[derive(Debug)]
@@ -16,7 +16,7 @@ mod impl_ {
1616
fn from(raw: RawSocket) -> Self {
1717
Self { raw }
1818
}
19-
}
19+
}
2020

2121
impl Registration {
2222
/// Registers the object into the reactor.
@@ -53,7 +53,7 @@ mod impl_ {
5353
use polling::{Event, PollMode, Poller};
5454

5555
use std::io::Result;
56-
use std::os::unix::io::{AsRawFd, RawFd};
56+
use std::os::unix::io::RawFd;
5757
use std::process::Child;
5858

5959
/// The raw registration into the reactor.
@@ -76,16 +76,7 @@ mod impl_ {
7676
fn from(raw: RawFd) -> Self {
7777
Self::Fd(raw)
7878
}
79-
}
80-
81-
impl AsRawFd for Registration {
82-
fn as_raw_fd(&self) -> RawFd {
83-
match self {
84-
Self::Fd(raw) => *raw,
85-
_ => panic!("not a file descriptor"),
86-
}
87-
}
88-
}
79+
}
8980

9081
impl From<Signal> for Registration {
9182
fn from(signal: Signal) -> Self {
@@ -157,7 +148,7 @@ mod impl_ {
157148
mod impl_ {
158149
use polling::{Event, Poller};
159150
use std::io::Result;
160-
use std::os::unix::io::{AsRawFd, RawFd};
151+
use std::os::unix::io::RawFd;
161152

162153
/// The raw registration into the reactor.
163154
#[derive(Debug)]
@@ -173,12 +164,6 @@ mod impl_ {
173164
}
174165
}
175166

176-
impl AsRawFd for Registration {
177-
fn as_raw_fd(&self) -> RawFd {
178-
self.raw
179-
}
180-
}
181-
182167
impl Registration {
183168
/// Registers the object into the reactor.
184169
pub(crate) fn add(&self, poller: &Poller, token: usize) -> Result<()> {

0 commit comments

Comments
 (0)