Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename BorrowFd::borrow_fd_fd to BorrowFd::borrow_raw. #21

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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