Merge pull request #91 from hyperium/fix/fail-to-panic
(fix) fail! to panic!
This commit is contained in:
@@ -90,7 +90,7 @@ fn bench_http(b: &mut test::Bencher) {
|
|||||||
// cant unwrap because Err contains RequestWriter, which does not implement Show
|
// cant unwrap because Err contains RequestWriter, which does not implement Show
|
||||||
let mut res = match req.read_response() {
|
let mut res = match req.read_response() {
|
||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(..) => fail!("http response failed")
|
Err(..) => panic!("http response failed")
|
||||||
};
|
};
|
||||||
res.read_to_string().unwrap();
|
res.read_to_string().unwrap();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ fn bench_mock_http(b: &mut test::Bencher) {
|
|||||||
// cant unwrap because Err contains RequestWriter, which does not implement Show
|
// cant unwrap because Err contains RequestWriter, which does not implement Show
|
||||||
let mut res = match req.read_response() {
|
let mut res = match req.read_response() {
|
||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(..) => fail!("http response failed")
|
Err(..) => panic!("http response failed")
|
||||||
};
|
};
|
||||||
res.read_to_string().unwrap();
|
res.read_to_string().unwrap();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ fn main() {
|
|||||||
println!("GET {}...", url)
|
println!("GET {}...", url)
|
||||||
url
|
url
|
||||||
},
|
},
|
||||||
Err(e) => fail!("Invalid URL: {}", e)
|
Err(e) => panic!("Invalid URL: {}", e)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
let req = match Request::get(url) {
|
let req = match Request::get(url) {
|
||||||
Ok(req) => req,
|
Ok(req) => req,
|
||||||
Err(err) => fail!("Failed to connect: {}", err)
|
Err(err) => panic!("Failed to connect: {}", err)
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut res = req
|
let mut res = req
|
||||||
@@ -39,7 +39,7 @@ fn main() {
|
|||||||
println!("{}", res.headers);
|
println!("{}", res.headers);
|
||||||
match copy(&mut res, &mut stdout()) {
|
match copy(&mut res, &mut stdout()) {
|
||||||
Ok(..) => (),
|
Ok(..) => (),
|
||||||
Err(e) => fail!("Stream failure: {}", e)
|
Err(e) => panic!("Stream failure: {}", e)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user