Skip to content

Commit

Permalink
Rename BorrowFd::borrow_fd_fd to BorrowFd::borrow_raw.
Browse files Browse the repository at this point in the history
This corresponds to rust-lang/rust#93663, which was recently merged.
  • Loading branch information
sunfishcode committed Mar 3, 2022
1 parent b7f5e97 commit 112a2ea
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 97 deletions.
34 changes: 17 additions & 17 deletions src/impls_async_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ use std::os::windows::io::{
impl AsFd for async_std::fs::File {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for async_std::fs::File {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

Expand Down Expand Up @@ -70,15 +70,15 @@ impl FromHandle for async_std::fs::File {
impl AsFd for async_std::net::TcpStream {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for async_std::net::TcpStream {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down Expand Up @@ -118,15 +118,15 @@ impl FromSocket for async_std::net::TcpStream {
impl AsFd for async_std::net::TcpListener {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for async_std::net::TcpListener {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down Expand Up @@ -166,15 +166,15 @@ impl FromSocket for async_std::net::TcpListener {
impl AsFd for async_std::net::UdpSocket {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for async_std::net::UdpSocket {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down Expand Up @@ -214,55 +214,55 @@ impl FromSocket for async_std::net::UdpSocket {
impl AsFd for async_std::io::Stdin {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for async_std::io::Stdin {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

#[cfg(any(unix, target_os = "wasi"))]
impl AsFd for async_std::io::Stdout {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for async_std::io::Stdout {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

#[cfg(any(unix, target_os = "wasi"))]
impl AsFd for async_std::io::Stderr {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for async_std::io::Stderr {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

#[cfg(unix)]
impl AsFd for async_std::os::unix::net::UnixStream {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand All @@ -286,7 +286,7 @@ impl FromFd for async_std::os::unix::net::UnixStream {
impl AsFd for async_std::os::unix::net::UnixListener {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand All @@ -310,7 +310,7 @@ impl FromFd for async_std::os::unix::net::UnixListener {
impl AsFd for async_std::os::unix::net::UnixDatagram {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/impls_fs_err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ use std::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle};
impl AsFd for fs_err::File {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for fs_err::File {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

Expand Down
22 changes: 11 additions & 11 deletions src/impls_mio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket};
impl AsFd for mio::net::TcpStream {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for mio::net::TcpStream {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down Expand Up @@ -65,15 +65,15 @@ impl FromSocket for mio::net::TcpStream {
impl AsFd for mio::net::TcpListener {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for mio::net::TcpListener {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down Expand Up @@ -113,15 +113,15 @@ impl FromSocket for mio::net::TcpListener {
impl AsFd for mio::net::UdpSocket {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for mio::net::UdpSocket {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down Expand Up @@ -161,7 +161,7 @@ impl FromSocket for mio::net::UdpSocket {
impl AsFd for mio::net::UnixDatagram {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand All @@ -185,7 +185,7 @@ impl FromFd for mio::net::UnixDatagram {
impl AsFd for mio::net::UnixListener {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand All @@ -209,7 +209,7 @@ impl FromFd for mio::net::UnixListener {
impl AsFd for mio::net::UnixStream {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand All @@ -233,7 +233,7 @@ impl FromFd for mio::net::UnixStream {
impl AsFd for mio::unix::pipe::Receiver {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand All @@ -257,7 +257,7 @@ impl FromFd for mio::unix::pipe::Receiver {
impl AsFd for mio::unix::pipe::Sender {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/impls_os_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ use std::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle};
impl AsFd for os_pipe::PipeReader {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for os_pipe::PipeReader {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

Expand Down Expand Up @@ -65,15 +65,15 @@ impl FromHandle for os_pipe::PipeReader {
impl AsFd for os_pipe::PipeWriter {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsHandle for os_pipe::PipeWriter {
#[inline]
fn as_handle(&self) -> BorrowedHandle<'_> {
unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) }
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/impls_socket2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket};
impl AsFd for socket2::Socket {
#[inline]
fn as_fd(&self) -> BorrowedFd<'_> {
unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) }
unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) }
}
}

#[cfg(windows)]
impl AsSocket for socket2::Socket {
#[inline]
fn as_socket(&self) -> BorrowedSocket<'_> {
unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) }
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}

Expand Down
Loading

0 comments on commit 112a2ea

Please sign in to comment.