Skip to content

Commit

Permalink
[http] impl debug for client
Browse files Browse the repository at this point in the history
Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
  • Loading branch information
zeylahellyer committed Oct 10, 2019
1 parent 72f055b commit 82e6bf1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion http/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use serde_json::json;
use snafu::ResultExt;
use std::{
convert::TryFrom,
fmt::{Debug, Formatter, Result as FmtResult},
ops::{Deref, DerefMut},
str::FromStr,
sync::Arc,
Expand Down Expand Up @@ -97,7 +98,19 @@ struct State {
use_http: bool,
}

#[derive(Clone)]
impl Debug for State {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
f.debug_struct("State")
.field("http", &"Reqwest HTTP client")
.field("ratelimiter", &self.ratelimiter)
.field("skip_ratelimiter", &self.skip_ratelimiter)
.field("token", &self.token)
.field("use_http", &self.use_http)
.finish()
}
}

#[derive(Clone, Debug)]
pub struct Client {
state: Arc<State>,
}
Expand Down

0 comments on commit 82e6bf1

Please sign in to comment.