mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 08:22:59 +01:00
add debug formatter for ClientRequestBuilder
This commit is contained in:
parent
e27bbaa55c
commit
fd0bb54469
@ -599,3 +599,19 @@ fn parts<'a>(parts: &'a mut Option<ClientRequest>, err: &Option<HttpError>)
|
|||||||
}
|
}
|
||||||
parts.as_mut()
|
parts.as_mut()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for ClientRequestBuilder {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
if let Some(ref parts) = self.request {
|
||||||
|
let res = write!(f, "\nClientRequestBuilder {:?} {}:{}\n",
|
||||||
|
parts.version, parts.method, parts.uri);
|
||||||
|
let _ = write!(f, " headers:\n");
|
||||||
|
for (key, val) in parts.headers.iter() {
|
||||||
|
let _ = write!(f, " {:?}: {:?}\n", key, val);
|
||||||
|
}
|
||||||
|
res
|
||||||
|
} else {
|
||||||
|
write!(f, "ClientRequestBuilder(Consumed)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user