File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ impl<'a> RobotFileParser<'a> {
248
248
let client = Client :: new ( ) ;
249
249
let request = client. get ( self . url . clone ( ) )
250
250
. header ( UserAgent ( USER_AGENT . to_owned ( ) ) ) ;
251
- let res = match request. send ( ) {
251
+ let mut res = match request. send ( ) {
252
252
Ok ( res) => res,
253
253
Err ( _) => {
254
254
return ;
@@ -261,13 +261,13 @@ impl<'a> RobotFileParser<'a> {
261
261
status if status >= StatusCode :: BadRequest && status < StatusCode :: InternalServerError => {
262
262
self . allow_all . set ( true ) ;
263
263
}
264
- StatusCode :: Ok => self . from_response ( res) ,
264
+ StatusCode :: Ok => self . from_response ( & mut res) ,
265
265
_ => { }
266
266
}
267
267
}
268
268
269
269
/// Reads the HTTP response and feeds it to the parser.
270
- pub fn from_response ( & self , mut response : Response ) {
270
+ pub fn from_response ( & self , response : & mut Response ) {
271
271
let mut buf = String :: new ( ) ;
272
272
response. read_to_string ( & mut buf) . unwrap ( ) ;
273
273
let lines: Vec < & str > = buf. split ( '\n' ) . collect ( ) ;
You can’t perform that action at this time.
0 commit comments