mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
Avoid allocation when return a WouldBlock io::Error (#65)
This commit is contained in:
committed by
Alex Crichton
parent
cf793d4053
commit
402cd3034d
+1
-1
@@ -77,7 +77,7 @@ impl TcpListener {
|
||||
/// called outside the context of a future.
|
||||
pub fn accept_std(&mut self) -> io::Result<(net::TcpStream, SocketAddr)> {
|
||||
if let Async::NotReady = self.io.poll_read() {
|
||||
return Err(io::Error::new(io::ErrorKind::WouldBlock, "not ready"))
|
||||
return Err(io::ErrorKind::WouldBlock.into())
|
||||
}
|
||||
|
||||
match self.io.get_ref().accept_std() {
|
||||
|
||||
Reference in New Issue
Block a user