feat(net): make HttpStream implement Debug

This commit is contained in:
Brandon Sanderson
2015-04-09 13:22:48 -07:00
parent 7262e91345
commit 7b7f9c257d

View File

@@ -253,6 +253,15 @@ pub enum HttpStream {
Https(SslStream<CloneTcpStream>), Https(SslStream<CloneTcpStream>),
} }
impl fmt::Debug for HttpStream {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match *self {
HttpStream::Http(_) => write!(fmt, "Http HttpStream"),
HttpStream::Https(_) => write!(fmt, "Https HttpStream"),
}
}
}
impl Read for HttpStream { impl Read for HttpStream {
#[inline] #[inline]
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {