File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ impl RobotsTxtClient for Client {
15
15
let url = Url :: parse ( & url) . map_err ( |err| RobotparserError { kind : ErrorKind :: Url ( err) } ) ?;
16
16
let mut request = Request :: new ( Method :: GET , url) ;
17
17
let _ = request. headers_mut ( ) . insert ( USER_AGENT , HeaderValue :: from_static ( DEFAULT_USER_AGENT ) ) ;
18
- let response = self . execute ( request) . map_err ( |err| RobotparserError { kind : ErrorKind :: HttpClient ( err) } ) ?;
18
+ let response = self . execute ( request) . map_err ( |err| RobotparserError { kind : ErrorKind :: Http ( err) } ) ?;
19
19
let status_code = response. status ( ) . as_u16 ( ) ;
20
- let text = response. text ( ) . map_err ( |err| RobotparserError { kind : ErrorKind :: HttpClient ( err) } ) ?;
20
+ let text = response. text ( ) . map_err ( |err| RobotparserError { kind : ErrorKind :: Http ( err) } ) ?;
21
21
let robots_txt = parse_fetched_robots_txt ( origin, status_code, & text) ;
22
22
return Ok ( robots_txt) ;
23
23
}
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ pub struct RobotparserError {
8
8
#[ derive( Debug ) ]
9
9
pub enum ErrorKind {
10
10
Url ( url:: ParseError ) ,
11
- HttpClient ( reqwest:: Error ) ,
11
+ Http ( reqwest:: Error ) ,
12
12
}
13
13
14
14
impl fmt:: Display for RobotparserError {
15
15
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
16
16
match self . kind {
17
17
ErrorKind :: Url ( ref err) => err. fmt ( f) ,
18
- ErrorKind :: HttpClient ( ref err) => err. fmt ( f) ,
18
+ ErrorKind :: Http ( ref err) => err. fmt ( f) ,
19
19
}
20
20
}
21
21
}
You can’t perform that action at this time.
0 commit comments