diff --git a/src/conn.rs b/src/conn.rs index 0c36e45..4f3bb9d 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -92,7 +92,7 @@ impl Connection, BufferedWriter> { } /// Modifies the internal TcpStream using a function. - fn mod_stream(&self, f: |&mut TcpStream| -> IoResult<()>) -> IoResult<()> { + fn mod_stream(&self, f: F) -> IoResult<()> where F: FnOnce(&mut TcpStream) -> IoResult<()> { match self.reader.lock().unwrap().get_mut() { &NetStream::UnsecuredTcpStream(ref mut tcp) => f(tcp), #[cfg(feature = "ssl")]