update and remove unnecessary dependencies
This commit is contained in:
10
Cargo.toml
10
Cargo.toml
@@ -12,18 +12,18 @@ categories = ["web-programming::http-client"]
|
|||||||
publish = false # pre
|
publish = false # pre
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "~0.6.0"
|
base64 = "0.9"
|
||||||
bytes = "0.4"
|
bytes = "0.4"
|
||||||
encoding_rs = "0.7"
|
encoding_rs = "0.8"
|
||||||
futures = "0.1.21"
|
futures = "0.1.23"
|
||||||
http = "0.1.5"
|
http = "0.1.5"
|
||||||
hyper = "0.12.2"
|
hyper = "0.12.7"
|
||||||
hyper-old-types = { version = "0.11", optional = true, features = ["compat"] }
|
hyper-old-types = { version = "0.11", optional = true, features = ["compat"] }
|
||||||
hyper-tls = "0.3"
|
hyper-tls = "0.3"
|
||||||
libflate = "0.1.11"
|
libflate = "0.1.11"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime = "0.3.7"
|
mime = "0.3.7"
|
||||||
mime_guess = "2.0.0-alpha.4"
|
mime_guess = "2.0.0-alpha.6"
|
||||||
native-tls = "0.2"
|
native-tls = "0.2"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|||||||
@@ -1,20 +1,11 @@
|
|||||||
#![allow(warnings)] // remove when error_chain is fixed
|
#![deny(warnings)]
|
||||||
|
|
||||||
//! `cargo run --example simple`
|
//! `cargo run --example simple`
|
||||||
|
|
||||||
extern crate reqwest;
|
extern crate reqwest;
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
#[macro_use]
|
|
||||||
extern crate error_chain;
|
|
||||||
|
|
||||||
error_chain! {
|
fn main() -> Result<(), Box<std::error::Error>> {
|
||||||
foreign_links {
|
|
||||||
ReqError(reqwest::Error);
|
|
||||||
IoError(std::io::Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn run() -> Result<()> {
|
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
println!("GET https://www.rust-lang.org");
|
println!("GET https://www.rust-lang.org");
|
||||||
@@ -25,10 +16,8 @@ fn run() -> Result<()> {
|
|||||||
println!("Headers:\n{:?}", res.headers());
|
println!("Headers:\n{:?}", res.headers());
|
||||||
|
|
||||||
// copy the response body directly to stdout
|
// copy the response body directly to stdout
|
||||||
let _ = std::io::copy(&mut res, &mut std::io::stdout())?;
|
std::io::copy(&mut res, &mut std::io::stdout())?;
|
||||||
|
|
||||||
println!("\n\nDone.");
|
println!("\n\nDone.");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
quick_main!(run);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user