Upgrade reqwest to 0.7

This commit is contained in:
messense 2017-08-09 13:16:27 +08:00
parent 63016cd97a
commit 44eb658238
No known key found for this signature in database
GPG key ID: BB41A8A2C716CCA9
2 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ version = "0.8.2"
url = "1.2" url = "1.2"
[dependencies.reqwest] [dependencies.reqwest]
version = "0.5" version = "0.7"
optional = true optional = true
[dependencies.clippy] [dependencies.clippy]

View file

@ -255,8 +255,8 @@ impl<'a> RobotFileParser<'a> {
/// Reads the robots.txt URL and feeds it to the parser. /// Reads the robots.txt URL and feeds it to the parser.
pub fn read(&self) { pub fn read(&self) {
let client = Client::new().expect("client failed to construct"); let client = Client::new().expect("client failed to construct");
let request = client.get(self.url.clone()) let mut request = client.get(self.url.clone()).expect("Invalid URL");
.header(UserAgent(USER_AGENT.to_owned())); let request = request.header(UserAgent::new(USER_AGENT.to_owned()));
let mut res = match request.send() { let mut res = match request.send() {
Ok(res) => res, Ok(res) => res,
Err(_) => { Err(_) => {