Replace IoResult and IoError with io:: versions. (#161)

This commit is contained in:
Jacob Hoffman-Andrews
2020-09-27 10:20:24 -07:00
committed by GitHub
parent e8c3403f7b
commit 7046b07518
6 changed files with 41 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
use std::collections::hash_map::Entry;
use std::collections::{HashMap, VecDeque};
use std::io::{Read, Result as IoResult};
use std::io::{self, Read};
use crate::stream::Stream;
use crate::unit::Unit;
@@ -395,7 +395,7 @@ impl<R: Read + Sized + Into<Stream>> PoolReturnRead<R> {
}
}
fn do_read(&mut self, buf: &mut [u8]) -> IoResult<usize> {
fn do_read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
match self.reader.as_mut() {
None => Ok(0),
Some(reader) => reader.read(buf),
@@ -404,7 +404,7 @@ impl<R: Read + Sized + Into<Stream>> PoolReturnRead<R> {
}
impl<R: Read + Sized + Into<Stream>> Read for PoolReturnRead<R> {
fn read(&mut self, buf: &mut [u8]) -> IoResult<usize> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
let amount = self.do_read(buf)?;
// only if the underlying reader is exhausted can we send a new
// request to the same socket. hence, we only return it now.