return TcpStreamNew for TcpStream::connect_std (#66)

This commit is contained in:
Thomas de Zeeuw
2017-12-06 14:59:57 -06:00
committed by Alex Crichton
parent 402cd3034d
commit 23a0e990d2
+3 -3
View File
@@ -299,13 +299,13 @@ impl TcpStream {
pub fn connect_std(stream: net::TcpStream,
addr: &SocketAddr,
handle: &Handle)
-> Box<Future<Item=TcpStream, Error=io::Error> + Send>
-> TcpStreamNew
{
let state = match mio::net::TcpStream::connect_stream(stream, addr) {
let inner = match mio::net::TcpStream::connect_stream(stream, addr) {
Ok(tcp) => TcpStream::new(tcp, handle),
Err(e) => TcpStreamNewState::Error(e),
};
Box::new(state)
TcpStreamNew { inner: inner }
}
/// Test whether this stream is ready to be read or not.