fix(rustup): update io import, Writer::write

Make it build with the latest rust-nightly (2015-01-27)

Renamed io import to old_io.
Renamed Writer::write to Writer::write_all
This commit is contained in:
Christian Stefanescu
2015-01-28 19:52:18 +01:00
committed by Sean McArthur
parent 537d691d61
commit f606b6039d
18 changed files with 81 additions and 81 deletions

View File

@@ -4,7 +4,7 @@ extern crate hyper;
extern crate test;
use std::fmt;
use std::io::net::ip::Ipv4Addr;
use std::old_io::net::ip::Ipv4Addr;
use hyper::server::{Request, Response, Server};
use hyper::header::Headers;
use hyper::Client;
@@ -26,7 +26,7 @@ macro_rules! try_return(
fn handle(_r: Request, res: Response) {
static BODY: &'static [u8] = b"Benchmarking hyper vs others!";
let mut res = try_return!(res.start());
try_return!(res.write(BODY));
try_return!(res.write_all(BODY));
try_return!(res.end());
}

View File

@@ -4,8 +4,8 @@ extern crate hyper;
extern crate test;
use std::fmt;
use std::io::{IoResult, MemReader};
use std::io::net::ip::SocketAddr;
use std::old_io::{IoResult, MemReader};
use std::old_io::net::ip::SocketAddr;
use hyper::net;
@@ -40,7 +40,7 @@ impl Reader for MockStream {
}
impl Writer for MockStream {
fn write(&mut self, _msg: &[u8]) -> IoResult<()> {
fn write_all(&mut self, _msg: &[u8]) -> IoResult<()> {
// we're mocking, what do we care.
Ok(())
}

View File

@@ -3,7 +3,7 @@ extern crate hyper;
extern crate test;
use test::Bencher;
use std::io::net::ip::Ipv4Addr;
use std::old_io::net::ip::Ipv4Addr;
use hyper::method::Method::Get;
use hyper::server::{Request, Response};
@@ -17,7 +17,7 @@ fn request(url: hyper::Url) {
fn hyper_handle(_: Request, res: Response) {
let mut res = res.start().unwrap();
res.write(PHRASE).unwrap();
res.write_all(PHRASE).unwrap();
res.end().unwrap();
}