(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
|
||||
let mut res = match req.read_response() {
|
||||
Ok(res) => res,
|
||||
Err(..) => fail!("http response failed")
|
||||
Err(..) => panic!("http response failed")
|
||||
};
|
||||
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
|
||||
let mut res = match req.read_response() {
|
||||
Ok(res) => res,
|
||||
Err(..) => fail!("http response failed")
|
||||
Err(..) => panic!("http response failed")
|
||||
};
|
||||
res.read_to_string().unwrap();
|
||||
});
|
||||
|
||||
@@ -22,13 +22,13 @@ fn main() {
|
||||
println!("GET {}...", url)
|
||||
url
|
||||
},
|
||||
Err(e) => fail!("Invalid URL: {}", e)
|
||||
Err(e) => panic!("Invalid URL: {}", e)
|
||||
};
|
||||
|
||||
|
||||
let req = match Request::get(url) {
|
||||
Ok(req) => req,
|
||||
Err(err) => fail!("Failed to connect: {}", err)
|
||||
Err(err) => panic!("Failed to connect: {}", err)
|
||||
};
|
||||
|
||||
let mut res = req
|
||||
@@ -39,7 +39,7 @@ fn main() {
|
||||
println!("{}", res.headers);
|
||||
match copy(&mut res, &mut stdout()) {
|
||||
Ok(..) => (),
|
||||
Err(e) => fail!("Stream failure: {}", e)
|
||||
Err(e) => panic!("Stream failure: {}", e)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user