Skip to content

Commit

Permalink
Update to newest master
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <dev@notgull.net>
  • Loading branch information
notgull committed Jan 13, 2024
1 parent 758b6eb commit 3f974ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/os/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ impl<T: AsHandle> Waitable<T> {
/// ```
pub fn new(handle: T) -> Result<Self> {
Ok(Self(Async {
source: Reactor::get().insert_io(unsafe { Registration::new_waitable(&handle) })?,
source: Reactor::get()
.insert_io(unsafe { Registration::new_waitable(handle.as_handle()) })?,
io: Some(handle),
}))
}
Expand Down
11 changes: 5 additions & 6 deletions src/reactor/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use polling::{Event, PollMode, Poller};
use std::fmt;
use std::io::Result;
use std::os::windows::io::{
AsHandle, AsRawHandle, AsRawSocket, AsSocket, BorrowedHandle, BorrowedSocket, RawHandle,
RawSocket,
AsRawHandle, AsRawSocket, BorrowedHandle, BorrowedSocket, RawHandle, RawSocket,
};

/// The raw registration into the reactor.
Expand Down Expand Up @@ -47,17 +46,17 @@ impl Registration {
/// # Safety
///
/// The provided file descriptor must be valid and not be closed while this object is alive.
pub(crate) unsafe fn new(f: impl AsSocket) -> Self {
Self::Socket(f.as_socket().as_raw_socket())
pub(crate) unsafe fn new(f: BorrowedSocket<'_>) -> Self {
Self::Socket(f.as_raw_socket())
}

/// Create a new [`Registration`] around a waitable handle.
///
/// # Safety
///
/// The provided handle must be valid and not be closed while this object is alive.
pub(crate) unsafe fn new_waitable(f: impl AsHandle) -> Self {
Self::Handle(f.as_handle().as_raw_handle())
pub(crate) unsafe fn new_waitable(f: BorrowedHandle<'_>) -> Self {
Self::Handle(f.as_raw_handle())
}

/// Registers the object into the reactor.
Expand Down

0 comments on commit 3f974ca

Please sign in to comment.