Merge pull request #13 from spk/update-request

Update reqwest to 0.8
This commit is contained in:
messense 2017-12-02 23:47:59 +08:00 committed by GitHub
commit 450cafadfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

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

View file

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