Skip to content

Commit de46ba2

Browse files
authored
Merge pull request #224 from alexcrichton/box-impl
Enusre `Box<T: TlsHandshake>` implements `TlsHandshake`
2 parents 6275056 + 4edcb7d commit de46ba2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

postgres/src/tls/mod.rs

Lines changed: 10 additions & 0 deletions
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)