Skip to content

Commit 4edcb7d

Browse files
committed
Enusre Box<T: TlsHandshake> implements TlsHandshake
1 parent 6275056 commit 4edcb7d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

postgres/src/tls/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ pub trait TlsHandshake: fmt::Debug {
3636
stream: Stream)
3737
-> Result<Box<TlsStream>, Box<Error + Sync + Send>>;
3838
}
39+
40+
impl<T: TlsHandshake + ?Sized> TlsHandshake for Box<T> {
41+
fn tls_handshake(&self,
42+
host: &str,
43+
stream: Stream)
44+
-> Result<Box<TlsStream>, Box<Error + Sync + Send>> {
45+
(**self).tls_handshake(host, stream)
46+
}
47+
}
48+

0 commit comments

Comments
 (0)