Skip to content

Commit a503f8b

Browse files
khueyseanmonstar
authored andcommitted
fix(client): impl<T: Connect> Connect for Box<T> (#1889)
1 parent 7f1b5f5 commit a503f8b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/client/connect/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ pub trait Connect: Send + Sync {
3535
fn connect(&self, dst: Destination) -> Self::Future;
3636
}
3737

38+
impl<T: Connect + ?Sized> Connect for Box<T> {
39+
type Transport = <T as Connect>::Transport;
40+
type Error = <T as Connect>::Error;
41+
type Future = <T as Connect>::Future;
42+
fn connect(&self, dst: Destination) -> Self::Future {
43+
<T as Connect>::connect(self, dst)
44+
}
45+
}
46+
3847
/// A set of properties to describe where and how to try to connect.
3948
///
4049
/// This type is passed an argument for the [`Connect`](Connect) trait.

0 commit comments

Comments
 (0)