mirror of
https://github.com/danbulant/robotparser-rs
synced 2026-05-19 04:18:42 +00:00
Upgrade reqwest to 0.7
This commit is contained in:
parent
63016cd97a
commit
44eb658238
2 changed files with 3 additions and 3 deletions
|
|
@ -14,7 +14,7 @@ version = "0.8.2"
|
|||
url = "1.2"
|
||||
|
||||
[dependencies.reqwest]
|
||||
version = "0.5"
|
||||
version = "0.7"
|
||||
optional = true
|
||||
|
||||
[dependencies.clippy]
|
||||
|
|
|
|||
|
|
@ -255,8 +255,8 @@ impl<'a> RobotFileParser<'a> {
|
|||
/// 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 request = client.get(self.url.clone())
|
||||
.header(UserAgent(USER_AGENT.to_owned()));
|
||||
let mut request = client.get(self.url.clone()).expect("Invalid URL");
|
||||
let request = request.header(UserAgent::new(USER_AGENT.to_owned()));
|
||||
let mut res = match request.send() {
|
||||
Ok(res) => res,
|
||||
Err(_) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue