Commit 1e7ff1d8 authored by Steven Fackler's avatar Steven Fackler
Browse files

Better debug impls

parent 0b76ee3b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -698,10 +698,11 @@ pub struct Ssl {
unsafe impl Send for Ssl {}
unsafe impl Sync for Ssl {}

// TODO: put useful information here
impl fmt::Debug for Ssl {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        write!(fmt, "Ssl")
        fmt.debug_struct("Ssl")
            .field("state", &self.get_state_string_long())
            .finish()
    }
}

@@ -1179,7 +1180,10 @@ impl SslStream<net::TcpStream> {

impl<S> fmt::Debug for SslStream<S> where S: fmt::Debug {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        write!(fmt, "SslStream {{ stream: {:?}, ssl: {:?} }}", self.kind.stream(), self.kind.ssl())
        fmt.debug_struct("SslStream")
            .field("stream", &self.kind.stream())
            .field("ssl", &self.kind.ssl())
            .finish()
    }
}