hyper-boring: Impl debug for MaybeHttpsStream

This commit is contained in:
4JX 2022-08-08 19:24:45 +02:00 committed by Joshua Nelson
parent a117901fe0
commit 3417b41b5b
1 changed files with 10 additions and 1 deletions

View File

@ -15,7 +15,6 @@ use hyper::client::HttpConnector;
use hyper::service::Service;
use hyper::Uri;
use once_cell::sync::OnceCell;
use std::error::Error;
use std::fmt::Debug;
use std::future::Future;
use std::io;
@ -23,6 +22,7 @@ use std::net;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use std::{error::Error, fmt};
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
use tokio_boring::SslStream;
use tower_layer::Layer;
@ -326,3 +326,12 @@ where
}
}
}
impl<T: fmt::Debug> fmt::Debug for MaybeHttpsStream<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
MaybeHttpsStream::Http(..) => f.pad("Http(..)"),
MaybeHttpsStream::Https(..) => f.pad("Https(..)"),
}
}
}