Skip to content

Commit 42eb9fb

Browse files
committed
Move Send bound for NoticeHandler to trait def
This is a breaking change
1 parent fe7b9f5 commit 42eb9fb

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl IntoConnectParams for Url {
199199
}
200200

201201
/// Trait for types that can handle Postgres notice messages
202-
pub trait NoticeHandler {
202+
pub trait NoticeHandler: Send {
203203
/// Handle a Postgres notice message
204204
fn handle(&mut self, notice: DbError);
205205
}
@@ -375,7 +375,7 @@ pub fn cancel_query<T>(params: T, ssl: &SslMode, data: CancelData)
375375
struct InnerConnection {
376376
stream: BufferedStream<MaybeSslStream<InternalStream>>,
377377
next_stmt_id: uint,
378-
notice_handler: Box<NoticeHandler+Send>,
378+
notice_handler: Box<NoticeHandler>,
379379
notifications: RingBuf<Notification>,
380380
cancel_data: CancelData,
381381
unknown_types: HashMap<Oid, String>,
@@ -534,7 +534,7 @@ impl InnerConnection {
534534
}
535535
}
536536

537-
fn set_notice_handler(&mut self, handler: Box<NoticeHandler+Send>) -> Box<NoticeHandler+Send> {
537+
fn set_notice_handler(&mut self, handler: Box<NoticeHandler>) -> Box<NoticeHandler> {
538538
mem::replace(&mut self.notice_handler, handler)
539539
}
540540

@@ -797,7 +797,7 @@ impl Connection {
797797
}
798798

799799
/// Sets the notice handler for the connection, returning the old handler.
800-
pub fn set_notice_handler(&self, handler: Box<NoticeHandler+Send>) -> Box<NoticeHandler+Send> {
800+
pub fn set_notice_handler(&self, handler: Box<NoticeHandler>) -> Box<NoticeHandler> {
801801
self.conn.borrow_mut().set_notice_handler(handler)
802802
}
803803

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ fn test_plaintext_pass_wrong_pass() {
737737
}
738738
}
739739

740-
#[test]
740+
#[test]
741741
fn test_md5_pass() {
742742
or_panic!(Connection::connect("postgres://md5_user:password@localhost/postgres", &SslMode::None));
743743
}

0 commit comments

Comments
 (0)