closure syntax
Signed-off-by: Peter Atashian <retep998@gmail.com>
This commit is contained in:
parent
39f0d597e8
commit
b2a1f2a6b9
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ impl Connection<BufferedReader<NetStream>, BufferedWriter<NetStream>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Modifies the internal TcpStream using a function.
|
/// Modifies the internal TcpStream using a function.
|
||||||
fn mod_stream(&self, f: |&mut TcpStream| -> IoResult<()>) -> IoResult<()> {
|
fn mod_stream<F>(&self, f: F) -> IoResult<()> where F: FnOnce(&mut TcpStream) -> IoResult<()> {
|
||||||
match self.reader.lock().unwrap().get_mut() {
|
match self.reader.lock().unwrap().get_mut() {
|
||||||
&NetStream::UnsecuredTcpStream(ref mut tcp) => f(tcp),
|
&NetStream::UnsecuredTcpStream(ref mut tcp) => f(tcp),
|
||||||
#[cfg(feature = "ssl")]
|
#[cfg(feature = "ssl")]
|
||||||
|
|
Loading…
Reference in a new issue