Skip to content

Commit

Permalink
fix(client): impl<T: Connect> Connect for Box<T> (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey authored and seanmonstar committed Aug 14, 2019
1 parent 7f1b5f5 commit a503f8b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/client/connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ pub trait Connect: Send + Sync {
fn connect(&self, dst: Destination) -> Self::Future;
}

impl<T: Connect + ?Sized> Connect for Box<T> {
type Transport = <T as Connect>::Transport;
type Error = <T as Connect>::Error;
type Future = <T as Connect>::Future;
fn connect(&self, dst: Destination) -> Self::Future {
<T as Connect>::connect(self, dst)
}
}

/// A set of properties to describe where and how to try to connect.
///
/// This type is passed an argument for the [`Connect`](Connect) trait.
Expand Down

0 comments on commit a503f8b

Please sign in to comment.