Enusre Box<T: TlsHandshake> implements TlsHandshake

This commit is contained in:
Alex Crichton
2016-12-30 14:46:14 -08:00
parent 6275056953
commit 4edcb7d334

View File

@@ -36,3 +36,13 @@ pub trait TlsHandshake: fmt::Debug {
stream: Stream)
-> Result<Box<TlsStream>, Box<Error + Sync + Send>>;
}
impl<T: TlsHandshake + ?Sized> TlsHandshake for Box<T> {
fn tls_handshake(&self,
host: &str,
stream: Stream)
-> Result<Box<TlsStream>, Box<Error + Sync + Send>> {
(**self).tls_handshake(host, stream)
}
}