File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 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 {
1515 let url = Url :: parse ( & url) . map_err ( |err| RobotparserError { kind : ErrorKind :: Url ( err) } ) ?;
1616 let mut request = Request :: new ( Method :: GET , url) ;
1717 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) } ) ?;
1919 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) } ) ?;
2121 let robots_txt = parse_fetched_robots_txt ( origin, status_code, & text) ;
2222 return Ok ( robots_txt) ;
2323 }
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ pub struct RobotparserError {
88#[ derive( Debug ) ]
99pub enum ErrorKind {
1010 Url ( url:: ParseError ) ,
11- HttpClient ( reqwest:: Error ) ,
11+ Http ( reqwest:: Error ) ,
1212}
1313
1414impl fmt:: Display for RobotparserError {
1515 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1616 match self . kind {
1717 ErrorKind :: Url ( ref err) => err. fmt ( f) ,
18- ErrorKind :: HttpClient ( ref err) => err. fmt ( f) ,
18+ ErrorKind :: Http ( ref err) => err. fmt ( f) ,
1919 }
2020 }
2121}
You can’t perform that action at this time.
0 commit comments