Skip to content

Commit

Permalink
Merge pull request #64 from euclio/remove-mut
Browse files Browse the repository at this point in the history
Remove unnecessary mutable borrows of self
  • Loading branch information
cyderize committed Dec 28, 2015
2 parents 0dc493d + 475e319 commit 95904b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<'a> Server<'a> {
})
}
/// Get the socket address of this server
pub fn local_addr(&mut self) -> io::Result<SocketAddr> {
pub fn local_addr(&self) -> io::Result<SocketAddr> {
self.inner.local_addr()
}

Expand Down
12 changes: 6 additions & 6 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ impl Write for WebSocketStream {

impl WebSocketStream {
/// See `TcpStream.peer_addr()`.
pub fn peer_addr(&mut self) -> io::Result<SocketAddr> {
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
match *self {
WebSocketStream::Tcp(ref mut inner) => inner.peer_addr(),
WebSocketStream::Ssl(ref mut inner) => inner.get_mut().peer_addr(),
WebSocketStream::Tcp(ref inner) => inner.peer_addr(),
WebSocketStream::Ssl(ref inner) => inner.get_ref().peer_addr(),
}
}
/// See `TcpStream.local_addr()`.
pub fn local_addr(&mut self) -> io::Result<SocketAddr> {
pub fn local_addr(&self) -> io::Result<SocketAddr> {
match *self {
WebSocketStream::Tcp(ref mut inner) => inner.local_addr(),
WebSocketStream::Ssl(ref mut inner) => inner.get_mut().local_addr(),
WebSocketStream::Tcp(ref inner) => inner.local_addr(),
WebSocketStream::Ssl(ref inner) => inner.get_ref().local_addr(),
}
}
/// See `TcpStream.set_nodelay()`.
Expand Down

0 comments on commit 95904b6

Please sign in to comment.