@@ -63,6 +63,7 @@ impl Client<HttpConnector> {
63
63
64
64
}
65
65
66
+ #[ old_impl_check]
66
67
impl < C : NetworkConnector < S > , S : NetworkStream > Client < C > {
67
68
68
69
/// Create a new client with a specific connector.
@@ -162,7 +163,7 @@ impl<'a, U: IntoUrl, C: NetworkConnector<S>, S: NetworkStream> RequestBuilder<'a
162
163
pub fn send ( self ) -> HttpResult < Response > {
163
164
let RequestBuilder { client, method, url, headers, body } = self ;
164
165
let mut url = try!( url. into_url ( ) ) ;
165
- debug ! ( "client.request {} {}" , method, url) ;
166
+ debug ! ( "client.request {:? } {:? }" , method, url) ;
166
167
167
168
let can_have_body = match & method {
168
169
& Method :: Get | & Method :: Head => false ,
@@ -193,13 +194,13 @@ impl<'a, U: IntoUrl, C: NetworkConnector<S>, S: NetworkStream> RequestBuilder<'a
193
194
if res. status . class ( ) != Redirection {
194
195
return Ok ( res)
195
196
}
196
- debug ! ( "redirect code {} for {}" , res. status, url) ;
197
+ debug ! ( "redirect code {:? } for {:? }" , res. status, url) ;
197
198
198
199
let loc = {
199
200
// punching borrowck here
200
201
let loc = match res. headers . get :: < Location > ( ) {
201
202
Some ( & Location ( ref loc) ) => {
202
- Some ( UrlParser :: new ( ) . base_url ( & url) . parse ( loc[ ] ) )
203
+ Some ( UrlParser :: new ( ) . base_url ( & url) . parse ( & loc[ ] ) )
203
204
}
204
205
None => {
205
206
debug ! ( "no Location header" ) ;
@@ -217,7 +218,7 @@ impl<'a, U: IntoUrl, C: NetworkConnector<S>, S: NetworkStream> RequestBuilder<'a
217
218
inspect ! ( "Location" , u)
218
219
} ,
219
220
Err ( e) => {
220
- debug ! ( "Location header had invalid URI: {}" , e) ;
221
+ debug ! ( "Location header had invalid URI: {:? }" , e) ;
221
222
return Ok ( res) ;
222
223
}
223
224
} ;
@@ -242,13 +243,13 @@ pub enum Body<'a> {
242
243
/// A Reader does not necessarily know it's size, so it is chunked.
243
244
ChunkedBody ( & ' a mut ( Reader + ' a ) ) ,
244
245
/// For Readers that can know their size, like a `File`.
245
- SizedBody ( & ' a mut ( Reader + ' a ) , uint ) ,
246
+ SizedBody ( & ' a mut ( Reader + ' a ) , usize ) ,
246
247
/// A String has a size, and uses Content-Length.
247
- BufBody ( & ' a [ u8 ] , uint ) ,
248
+ BufBody ( & ' a [ u8 ] , usize ) ,
248
249
}
249
250
250
251
impl < ' a > Body < ' a > {
251
- fn size ( & self ) -> Option < uint > {
252
+ fn size ( & self ) -> Option < usize > {
252
253
match * self {
253
254
Body :: SizedBody ( _, len) | Body :: BufBody ( _, len) => Some ( len) ,
254
255
_ => None
@@ -258,7 +259,7 @@ impl<'a> Body<'a> {
258
259
259
260
impl < ' a > Reader for Body < ' a > {
260
261
#[ inline]
261
- fn read ( & mut self , buf : & mut [ u8 ] ) -> IoResult < uint > {
262
+ fn read ( & mut self , buf : & mut [ u8 ] ) -> IoResult < usize > {
262
263
match * self {
263
264
Body :: ChunkedBody ( ref mut r) => r. read ( buf) ,
264
265
Body :: SizedBody ( ref mut r, _) => r. read ( buf) ,
@@ -343,12 +344,12 @@ fn get_host_and_port(url: &Url) -> HttpResult<(String, Port)> {
343
344
Some ( host) => host,
344
345
None => return Err ( HttpUriError ( UrlError :: EmptyHost ) )
345
346
} ;
346
- debug ! ( "host={}" , host) ;
347
+ debug ! ( "host={:? }" , host) ;
347
348
let port = match url. port_or_default ( ) {
348
349
Some ( port) => port,
349
350
None => return Err ( HttpUriError ( UrlError :: InvalidPort ) )
350
351
} ;
351
- debug ! ( "port={}" , port) ;
352
+ debug ! ( "port={:? }" , port) ;
352
353
Ok ( ( host, port) )
353
354
}
354
355
0 commit comments