mirror of
https://github.com/danbulant/robotparser-rs
synced 2026-05-27 14:01:48 +00:00
commit
450cafadfd
2 changed files with 3 additions and 3 deletions
|
|
@ -14,7 +14,7 @@ version = "0.9.0"
|
||||||
url = "1.2"
|
url = "1.2"
|
||||||
|
|
||||||
[dependencies.reqwest]
|
[dependencies.reqwest]
|
||||||
version = "0.7"
|
version = "0.8"
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[dependencies.clippy]
|
[dependencies.clippy]
|
||||||
|
|
|
||||||
|
|
@ -254,8 +254,8 @@ impl<'a> RobotFileParser<'a> {
|
||||||
#[cfg(feature = "http")]
|
#[cfg(feature = "http")]
|
||||||
/// 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();
|
||||||
let mut request = client.get(self.url.clone()).expect("Invalid URL");
|
let mut request = client.get(self.url.clone());
|
||||||
let request = request.header(UserAgent::new(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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue