diff --git a/src/impls_async_std.rs b/src/impls_async_std.rs index 5ecdcfa..f33e38a 100644 --- a/src/impls_async_std.rs +++ b/src/impls_async_std.rs @@ -22,7 +22,7 @@ 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()) } } } @@ -30,7 +30,7 @@ impl AsFd for async_std::fs::File { 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()) } } } @@ -70,7 +70,7 @@ 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()) } } } @@ -78,7 +78,7 @@ impl AsFd for async_std::net::TcpStream { 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()) } } } @@ -118,7 +118,7 @@ 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()) } } } @@ -126,7 +126,7 @@ impl AsFd for async_std::net::TcpListener { 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()) } } } @@ -166,7 +166,7 @@ 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()) } } } @@ -174,7 +174,7 @@ impl AsFd for async_std::net::UdpSocket { 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()) } } } @@ -214,7 +214,7 @@ 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()) } } } @@ -222,7 +222,7 @@ impl AsFd for async_std::io::Stdin { 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()) } } } @@ -230,7 +230,7 @@ impl AsHandle for async_std::io::Stdin { 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()) } } } @@ -238,7 +238,7 @@ impl AsFd for async_std::io::Stdout { 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()) } } } @@ -246,7 +246,7 @@ impl AsHandle for async_std::io::Stdout { 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()) } } } @@ -254,7 +254,7 @@ impl AsFd for async_std::io::Stderr { 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()) } } } @@ -262,7 +262,7 @@ impl AsHandle for async_std::io::Stderr { 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()) } } } @@ -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()) } } } @@ -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()) } } } diff --git a/src/impls_fs_err.rs b/src/impls_fs_err.rs index cba6ee6..5e1e1d2 100644 --- a/src/impls_fs_err.rs +++ b/src/impls_fs_err.rs @@ -17,7 +17,7 @@ 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()) } } } @@ -25,7 +25,7 @@ impl AsFd for fs_err::File { 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()) } } } diff --git a/src/impls_mio.rs b/src/impls_mio.rs index e0fd9a4..28d85d0 100644 --- a/src/impls_mio.rs +++ b/src/impls_mio.rs @@ -17,7 +17,7 @@ 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()) } } } @@ -25,7 +25,7 @@ impl AsFd for mio::net::TcpStream { 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()) } } } @@ -65,7 +65,7 @@ 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()) } } } @@ -73,7 +73,7 @@ impl AsFd for mio::net::TcpListener { 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()) } } } @@ -113,7 +113,7 @@ 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()) } } } @@ -121,7 +121,7 @@ impl AsFd for mio::net::UdpSocket { 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()) } } } @@ -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()) } } } @@ -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()) } } } @@ -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()) } } } @@ -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()) } } } @@ -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()) } } } diff --git a/src/impls_os_pipe.rs b/src/impls_os_pipe.rs index 9b32080..978671c 100644 --- a/src/impls_os_pipe.rs +++ b/src/impls_os_pipe.rs @@ -17,7 +17,7 @@ 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()) } } } @@ -25,7 +25,7 @@ impl AsFd for os_pipe::PipeReader { 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()) } } } @@ -65,7 +65,7 @@ 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()) } } } @@ -73,7 +73,7 @@ impl AsFd for os_pipe::PipeWriter { 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()) } } } diff --git a/src/impls_socket2.rs b/src/impls_socket2.rs index 7ccd286..a39443e 100644 --- a/src/impls_socket2.rs +++ b/src/impls_socket2.rs @@ -17,7 +17,7 @@ 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()) } } } @@ -25,7 +25,7 @@ impl AsFd for socket2::Socket { 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()) } } } diff --git a/src/impls_std.rs b/src/impls_std.rs index 308ae6d..643c607 100644 --- a/src/impls_std.rs +++ b/src/impls_std.rs @@ -19,7 +19,7 @@ use std::os::windows::io::{ impl AsFd for BorrowedFd<'_> { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -27,7 +27,7 @@ impl AsFd for BorrowedFd<'_> { impl AsHandle for BorrowedHandle<'_> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -35,7 +35,7 @@ impl AsHandle for BorrowedHandle<'_> { impl AsSocket for BorrowedSocket<'_> { #[inline] fn as_socket(&self) -> BorrowedSocket<'_> { - unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) } + unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) } } } @@ -43,7 +43,7 @@ impl AsSocket for BorrowedSocket<'_> { impl AsFd for OwnedFd { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -51,7 +51,7 @@ impl AsFd for OwnedFd { impl AsHandle for OwnedHandle { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -59,7 +59,7 @@ impl AsHandle for OwnedHandle { impl AsSocket for OwnedSocket { #[inline] fn as_socket(&self) -> BorrowedSocket<'_> { - unsafe { BorrowedSocket::borrow_raw_socket(self.as_raw_socket()) } + unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) } } } @@ -123,7 +123,7 @@ impl FromHandle for HandleOrInvalid { impl AsFd for 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()) } } } @@ -131,7 +131,7 @@ impl AsFd for std::fs::File { impl AsHandle for 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()) } } } @@ -171,7 +171,7 @@ impl FromHandle for std::fs::File { impl AsFd for 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()) } } } @@ -179,7 +179,7 @@ impl AsFd for std::net::TcpStream { impl AsSocket for 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()) } } } @@ -219,7 +219,7 @@ impl FromSocket for std::net::TcpStream { impl AsFd for 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()) } } } @@ -227,7 +227,7 @@ impl AsFd for std::net::TcpListener { impl AsSocket for 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()) } } } @@ -267,7 +267,7 @@ impl FromSocket for std::net::TcpListener { impl AsFd for 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()) } } } @@ -275,7 +275,7 @@ impl AsFd for std::net::UdpSocket { impl AsSocket for 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()) } } } @@ -315,7 +315,7 @@ impl FromSocket for std::net::UdpSocket { impl AsFd for 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()) } } } @@ -323,7 +323,7 @@ impl AsFd for std::io::Stdin { impl AsHandle for 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()) } } } @@ -331,7 +331,7 @@ impl AsHandle for std::io::Stdin { impl<'a> AsFd for std::io::StdinLock<'a> { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -339,7 +339,7 @@ impl<'a> AsFd for std::io::StdinLock<'a> { impl<'a> AsHandle for std::io::StdinLock<'a> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -347,7 +347,7 @@ impl<'a> AsHandle for std::io::StdinLock<'a> { impl AsFd for 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()) } } } @@ -355,7 +355,7 @@ impl AsFd for std::io::Stdout { impl AsHandle for 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()) } } } @@ -363,7 +363,7 @@ impl AsHandle for std::io::Stdout { impl<'a> AsFd for std::io::StdoutLock<'a> { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -371,7 +371,7 @@ impl<'a> AsFd for std::io::StdoutLock<'a> { impl<'a> AsHandle for std::io::StdoutLock<'a> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -379,7 +379,7 @@ impl<'a> AsHandle for std::io::StdoutLock<'a> { impl AsFd for 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()) } } } @@ -387,7 +387,7 @@ impl AsFd for std::io::Stderr { impl AsHandle for 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()) } } } @@ -395,7 +395,7 @@ impl AsHandle for std::io::Stderr { impl<'a> AsFd for std::io::StderrLock<'a> { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -403,7 +403,7 @@ impl<'a> AsFd for std::io::StderrLock<'a> { impl<'a> AsHandle for std::io::StderrLock<'a> { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -411,7 +411,7 @@ impl<'a> AsHandle for std::io::StderrLock<'a> { impl AsFd for std::process::ChildStdin { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -419,7 +419,7 @@ impl AsFd for std::process::ChildStdin { impl AsHandle for std::process::ChildStdin { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -443,7 +443,7 @@ impl IntoHandle for std::process::ChildStdin { impl AsFd for std::process::ChildStdout { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -451,7 +451,7 @@ impl AsFd for std::process::ChildStdout { impl AsHandle for std::process::ChildStdout { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -475,7 +475,7 @@ impl IntoHandle for std::process::ChildStdout { impl AsFd for std::process::ChildStderr { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -483,7 +483,7 @@ impl AsFd for std::process::ChildStderr { impl AsHandle for std::process::ChildStderr { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -523,7 +523,7 @@ impl FromHandle for std::process::Stdio { impl AsHandle for std::process::Child { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -539,7 +539,7 @@ impl IntoHandle for std::process::Child { impl AsFd for 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()) } } } @@ -563,7 +563,7 @@ impl FromFd for std::os::unix::net::UnixStream { impl AsFd for 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()) } } } @@ -587,7 +587,7 @@ impl FromFd for std::os::unix::net::UnixListener { impl AsFd for 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()) } } } @@ -611,7 +611,7 @@ impl FromFd for std::os::unix::net::UnixDatagram { impl AsHandle for std::thread::JoinHandle { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } diff --git a/src/impls_tokio.rs b/src/impls_tokio.rs index 2525978..abe2ef6 100644 --- a/src/impls_tokio.rs +++ b/src/impls_tokio.rs @@ -17,7 +17,7 @@ use std::os::windows::io::{AsRawHandle, AsRawSocket, FromRawHandle, IntoRawHandl impl AsFd for tokio::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()) } } } @@ -25,7 +25,7 @@ impl AsFd for tokio::fs::File { impl AsHandle for tokio::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()) } } } @@ -49,7 +49,7 @@ impl FromHandle for tokio::fs::File { impl AsFd for tokio::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()) } } } @@ -57,7 +57,7 @@ impl AsFd for tokio::net::TcpStream { impl AsSocket for tokio::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()) } } } @@ -65,7 +65,7 @@ impl AsSocket for tokio::net::TcpStream { impl AsFd for tokio::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()) } } } @@ -73,7 +73,7 @@ impl AsFd for tokio::net::TcpListener { impl AsSocket for tokio::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()) } } } @@ -81,7 +81,7 @@ impl AsSocket for tokio::net::TcpListener { impl AsFd for tokio::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()) } } } @@ -89,7 +89,7 @@ impl AsFd for tokio::net::UdpSocket { impl AsSocket for tokio::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()) } } } @@ -97,7 +97,7 @@ impl AsSocket for tokio::net::UdpSocket { impl AsFd for tokio::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()) } } } @@ -105,7 +105,7 @@ impl AsFd for tokio::io::Stdin { impl AsHandle for tokio::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()) } } } @@ -113,7 +113,7 @@ impl AsHandle for tokio::io::Stdin { impl AsFd for tokio::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()) } } } @@ -121,7 +121,7 @@ impl AsFd for tokio::io::Stdout { impl AsHandle for tokio::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()) } } } @@ -129,7 +129,7 @@ impl AsHandle for tokio::io::Stdout { impl AsFd for tokio::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()) } } } @@ -137,7 +137,7 @@ impl AsFd for tokio::io::Stderr { impl AsHandle for tokio::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()) } } } @@ -145,7 +145,7 @@ impl AsHandle for tokio::io::Stderr { impl AsFd for tokio::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()) } } } @@ -153,7 +153,7 @@ impl AsFd for tokio::net::UnixStream { impl AsFd for tokio::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()) } } } @@ -161,7 +161,7 @@ impl AsFd for tokio::net::UnixListener { impl AsFd for tokio::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()) } } } @@ -169,7 +169,7 @@ impl AsFd for tokio::net::UnixDatagram { impl AsFd for tokio::process::ChildStdout { #[inline] fn as_fd(&self) -> BorrowedFd<'_> { - unsafe { BorrowedFd::borrow_raw_fd(self.as_raw_fd()) } + unsafe { BorrowedFd::borrow_raw(self.as_raw_fd()) } } } @@ -177,7 +177,7 @@ impl AsFd for tokio::process::ChildStdout { impl AsHandle for tokio::process::ChildStdin { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -185,7 +185,7 @@ impl AsHandle for tokio::process::ChildStdin { impl AsHandle for tokio::process::ChildStdout { #[inline] fn as_handle(&self) -> BorrowedHandle<'_> { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } @@ -193,6 +193,6 @@ impl AsHandle for tokio::process::ChildStdout { impl AsHandle for tokio::process::ChildStderr { #[inline] fn as_handle(&self) -> BorrowedHandle { - unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } + unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) } } } diff --git a/src/types.rs b/src/types.rs index 75615ec..2543a90 100644 --- a/src/types.rs +++ b/src/types.rs @@ -426,7 +426,7 @@ impl BorrowedFd<'_> { /// The resource pointed to by `raw` must remain open for the duration of /// the returned `BorrowedFd`, and it must not have the value `-1`. #[inline] - pub unsafe fn borrow_raw_fd(fd: RawFd) -> Self { + pub unsafe fn borrow_raw(fd: RawFd) -> Self { debug_assert_ne!(fd, -1_i32 as RawFd); Self { fd, @@ -444,7 +444,7 @@ impl BorrowedHandle<'_> { /// The resource pointed to by `raw` must remain open for the duration of /// the returned `BorrowedHandle`, and it must not be null. #[inline] - pub unsafe fn borrow_raw_handle(handle: RawHandle) -> Self { + pub unsafe fn borrow_raw(handle: RawHandle) -> Self { debug_assert!(!handle.is_null()); Self { handle, @@ -463,7 +463,7 @@ impl BorrowedSocket<'_> { /// the returned `BorrowedSocket`, and it must not have the value /// [`INVALID_SOCKET`]. #[inline] - pub unsafe fn borrow_raw_socket(socket: RawSocket) -> Self { + pub unsafe fn borrow_raw(socket: RawSocket) -> Self { debug_assert_ne!(socket, INVALID_SOCKET as RawSocket); Self { socket,