@@ -561,7 +561,7 @@ impl Response {
561
561
/// let resp = ureq::Response::do_from_read(read);
562
562
///
563
563
/// assert_eq!(resp.status(), 401);
564
- pub ( crate ) fn do_from_stream ( stream : Stream , unit : Unit ) -> Result < Response , Error > {
564
+ pub ( crate ) fn do_from_stream ( stream : Stream , unit : & Unit ) -> Result < Response , Error > {
565
565
let remote_addr = stream. remote_addr ;
566
566
567
567
let local_addr = match stream. socket ( ) {
@@ -609,7 +609,7 @@ impl Response {
609
609
}
610
610
611
611
let reader =
612
- Self :: stream_to_reader ( stream, & unit, body_type, compression, connection_option) ;
612
+ Self :: stream_to_reader ( stream, unit, body_type, compression, connection_option) ;
613
613
614
614
let url = unit. url . clone ( ) ;
615
615
@@ -766,7 +766,7 @@ impl FromStr for Response {
766
766
& request_reader,
767
767
None ,
768
768
) ;
769
- Self :: do_from_stream ( stream, unit)
769
+ Self :: do_from_stream ( stream, & unit)
770
770
}
771
771
}
772
772
@@ -1150,7 +1150,7 @@ mod tests {
1150
1150
& request_reader,
1151
1151
None ,
1152
1152
) ;
1153
- let resp = Response :: do_from_stream ( s. into ( ) , unit) . unwrap ( ) ;
1153
+ let resp = Response :: do_from_stream ( s. into ( ) , & unit) . unwrap ( ) ;
1154
1154
assert_eq ! ( resp. status( ) , 200 ) ;
1155
1155
assert_eq ! ( resp. header( "x-geo-header" ) , None ) ;
1156
1156
}
@@ -1206,7 +1206,7 @@ mod tests {
1206
1206
) ;
1207
1207
Response :: do_from_stream (
1208
1208
stream,
1209
- Unit :: new (
1209
+ & Unit :: new (
1210
1210
& agent,
1211
1211
"GET" ,
1212
1212
& "https://example.com/" . parse ( ) . unwrap ( ) ,
@@ -1238,7 +1238,7 @@ mod tests {
1238
1238
) ;
1239
1239
let resp = Response :: do_from_stream (
1240
1240
stream,
1241
- Unit :: new (
1241
+ & Unit :: new (
1242
1242
& agent,
1243
1243
"GET" ,
1244
1244
& "https://example.com/" . parse ( ) . unwrap ( ) ,
0 commit comments