From db90323b0806f6fb00f5012b2e80fe8658f19224 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 19 Oct 2020 19:58:41 -0400 Subject: [PATCH] Make postgres::Client Send again Closes #677 --- postgres/src/connection.rs | 4 ++-- postgres/src/test.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/postgres/src/connection.rs b/postgres/src/connection.rs index bc8564f5..453eef3a 100644 --- a/postgres/src/connection.rs +++ b/postgres/src/connection.rs @@ -16,14 +16,14 @@ pub struct Connection { runtime: Runtime, connection: Pin> + Send>>, notifications: VecDeque, - notice_callback: Arc, + notice_callback: Arc, } impl Connection { pub fn new( runtime: Runtime, connection: tokio_postgres::Connection, - notice_callback: Arc, + notice_callback: Arc, ) -> Connection where S: AsyncRead + AsyncWrite + Unpin + 'static + Send, diff --git a/postgres/src/test.rs b/postgres/src/test.rs index dcf202ef..0fd40457 100644 --- a/postgres/src/test.rs +++ b/postgres/src/test.rs @@ -499,3 +499,12 @@ fn explicit_close() { let client = Client::connect("host=localhost port=5433 user=postgres", NoTls).unwrap(); client.close().unwrap(); } + +#[test] +fn check_send() { + fn is_send() {} + + is_send::(); + is_send::(); + is_send::>(); +}