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:
committed by
Sean McArthur
parent
537d691d61
commit
f606b6039d
@@ -2,8 +2,8 @@
|
||||
extern crate hyper;
|
||||
|
||||
use std::os;
|
||||
use std::io::stdout;
|
||||
use std::io::util::copy;
|
||||
use std::old_io::stdout;
|
||||
use std::old_io::util::copy;
|
||||
|
||||
use hyper::Client;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#![allow(unstable)]
|
||||
extern crate hyper;
|
||||
|
||||
use std::io::net::ip::Ipv4Addr;
|
||||
use std::old_io::net::ip::Ipv4Addr;
|
||||
use hyper::server::{Request, Response};
|
||||
|
||||
static PHRASE: &'static [u8] = b"Hello World!";
|
||||
|
||||
fn hello(_: Request, res: Response) {
|
||||
let mut res = res.start().unwrap();
|
||||
res.write(PHRASE).unwrap();
|
||||
res.write_all(PHRASE).unwrap();
|
||||
res.end().unwrap();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
extern crate hyper;
|
||||
#[macro_use] extern crate log;
|
||||
|
||||
use std::io::util::copy;
|
||||
use std::io::net::ip::Ipv4Addr;
|
||||
use std::old_io::util::copy;
|
||||
use std::old_io::net::ip::Ipv4Addr;
|
||||
|
||||
use hyper::{Get, Post};
|
||||
use hyper::header::ContentLength;
|
||||
@@ -27,7 +27,7 @@ fn echo(mut req: Request, mut res: Response) {
|
||||
|
||||
res.headers_mut().set(ContentLength(out.len() as u64));
|
||||
let mut res = try_return!(res.start());
|
||||
try_return!(res.write(out));
|
||||
try_return!(res.write_all(out));
|
||||
try_return!(res.end());
|
||||
return;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user