Skip to content

Commit

Permalink
Make various {set,get}socktopt methods on Connection take ref
Browse files Browse the repository at this point in the history
Instead of a mutable reference.
  • Loading branch information
Thomasdezeeuw committed Jun 14, 2024
1 parent 8e98981 commit dca2b17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions http/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,22 +696,22 @@ impl Connection {
}

/// See [`TcpStream::peer_addr`].
pub fn peer_addr(&mut self) -> io::Result<SocketAddr> {
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
self.stream.peer_addr()
}

/// See [`TcpStream::local_addr`].
pub fn local_addr(&mut self) -> io::Result<SocketAddr> {
pub fn local_addr(&self) -> io::Result<SocketAddr> {
self.stream.local_addr()
}

/// See [`TcpStream::set_nodelay`].
pub fn set_nodelay(&mut self, nodelay: bool) -> io::Result<()> {
pub fn set_nodelay(&self, nodelay: bool) -> io::Result<()> {
self.stream.set_nodelay(nodelay)
}

/// See [`TcpStream::nodelay`].
pub fn nodelay(&mut self) -> io::Result<bool> {
pub fn nodelay(&self) -> io::Result<bool> {
self.stream.nodelay()
}

Expand Down

0 comments on commit dca2b17

Please sign in to comment.