rustup: sweeping fixes for all the changes in 1.0-alpha

- Some switches to u64 instead of usize
- For now, allow(unstable)
- use associated types for all the Network stuff
This commit is contained in:
Sean McArthur
2015-01-10 00:46:43 -08:00
parent 4026ec1d73
commit f7124bb8e2
24 changed files with 232 additions and 362 deletions

View File

@@ -1,5 +1,4 @@
#![feature(macro_rules)]
extern crate curl;
#![allow(unstable)]
extern crate hyper;
extern crate test;
@@ -31,21 +30,6 @@ fn handle(_r: Request, res: Response) {
try_return!(res.end());
}
#[bench]
fn bench_curl(b: &mut test::Bencher) {
let mut listening = listen();
let s = format!("http://{}/", listening.socket);
let url = s.as_slice();
b.iter(|| {
curl::http::handle()
.get(url)
.header("X-Foo", "Bar")
.exec()
.unwrap()
});
listening.close().unwrap();
}
#[derive(Clone)]
struct Foo;

View File

@@ -1,5 +1,4 @@
#![feature(default_type_params)]
extern crate curl;
#![allow(unstable)]
extern crate hyper;
extern crate test;
@@ -49,21 +48,6 @@ impl Writer for MockStream {
}
}
#[bench]
fn bench_mock_curl(b: &mut test::Bencher) {
let mut cwd = os::getcwd().unwrap();
cwd.push("README.md");
let s = format!("file://{}", cwd.container_as_str().unwrap());
let url = s.as_slice();
b.iter(|| {
curl::http::handle()
.get(url)
.header("X-Foo", "Bar")
.exec()
.unwrap()
});
}
#[derive(Clone)]
struct Foo;
@@ -90,7 +74,8 @@ impl net::NetworkStream for MockStream {
struct MockConnector;
impl net::NetworkConnector<MockStream> for MockConnector {
impl net::NetworkConnector for MockConnector {
type Stream = MockStream;
fn connect(&mut self, _: &str, _: u16, _: &str) -> IoResult<MockStream> {
Ok(MockStream::new())
}

View File

@@ -1,3 +1,4 @@
#![allow(unstable)]
extern crate hyper;
extern crate test;