Skip to content
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
6 changes: 6 additions & 0 deletions tokio/src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,12 @@ impl fmt::Debug for TcpStream {
}
}

impl AsRef<Self> for TcpStream {
fn as_ref(&self) -> &Self {
self
}
}

#[cfg(unix)]
mod sys {
use super::TcpStream;
Expand Down
6 changes: 6 additions & 0 deletions tokio/src/net/unix/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,12 @@ impl fmt::Debug for UnixStream {
}
}

impl AsRef<Self> for UnixStream {
fn as_ref(&self) -> &Self {
self
}
}

impl AsRawFd for UnixStream {
fn as_raw_fd(&self) -> RawFd {
self.io.as_raw_fd()
Expand Down
Loading