added custom Debug implementation for ClientWithMiddleware, skipping middleware_stack field (#22)

pull/27/head
Christian Haynes 2021-12-06 11:18:49 -05:00 committed by GitHub
parent 525f62039f
commit 6cbea8d7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -3,7 +3,7 @@ use reqwest::multipart::Form;
use reqwest::{Body, Client, IntoUrl, Method, Request, Response};
use serde::Serialize;
use std::convert::TryFrom;
use std::fmt::Display;
use std::fmt::{self, Display};
use std::sync::Arc;
use std::time::Duration;
use task_local_extensions::Extensions;
@ -138,6 +138,15 @@ impl From<Client> for ClientWithMiddleware {
}
}
impl fmt::Debug for ClientWithMiddleware {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// skipping middleware_stack field for now
f.debug_struct("ClientWithMiddleware")
.field("inner", &self.inner)
.finish()
}
}
/// This is a wrapper around [`reqwest::RequestBuilder`] exposing the same API.
#[must_use = "RequestBuilder does nothing until you 'send' it"]
pub struct RequestBuilder {