Skip to content

Commit 5c3447c

Browse files
committed
initial tokio
1 parent a8dc23a commit 5c3447c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/client/pool.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,20 @@ pub(super) trait Poolable: Unpin + Send + Sized + 'static {
4343
fn can_share(&self) -> bool;
4444
}
4545

46-
pub trait Key: Eq + Hash + Clone + Debug + Unpin {}
46+
pub trait Key: Eq + Hash + Clone + Debug + Unpin + Send + 'static {}
47+
48+
impl<T> Key for T where T: Eq + Hash + Clone + Debug + Unpin + Send + 'static {}
49+
50+
type OldKey = (http::uri::Scheme, http::uri::Authority);
51+
52+
fn assert() {
53+
let x: OldKey = (http::uri::Scheme::HTTP, "x".parse().expect("host key"));
54+
test(x);
55+
}
56+
fn test<T: Key>(a: T) {
57+
}
58+
59+
// impl Key for OldKey {}
4760

4861
/// When checking out a pooled connection, it might be that the connection
4962
/// only supports a single reservation, or it might be usable for many.
@@ -810,8 +823,6 @@ mod tests {
810823
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
811824
struct KeyImpl (http::uri::Scheme, http::uri::Authority);
812825

813-
impl Key for KeyImpl {}
814-
815826
type KeyTuple = (http::uri::Scheme, http::uri::Authority);
816827

817828
/// Test unique reservations.

0 commit comments

Comments
 (0)