Move Send bound for NoticeHandler to trait def

This is a breaking change
This commit is contained in:
Steven Fackler 2014-12-08 23:43:01 -08:00
parent fe7b9f5435
commit 42eb9fb01e
2 changed files with 5 additions and 5 deletions

View File

@ -199,7 +199,7 @@ impl IntoConnectParams for Url {
}
/// Trait for types that can handle Postgres notice messages
pub trait NoticeHandler {
pub trait NoticeHandler: Send {
/// Handle a Postgres notice message
fn handle(&mut self, notice: DbError);
}
@ -375,7 +375,7 @@ pub fn cancel_query<T>(params: T, ssl: &SslMode, data: CancelData)
struct InnerConnection {
stream: BufferedStream<MaybeSslStream<InternalStream>>,
next_stmt_id: uint,
notice_handler: Box<NoticeHandler+Send>,
notice_handler: Box<NoticeHandler>,
notifications: RingBuf<Notification>,
cancel_data: CancelData,
unknown_types: HashMap<Oid, String>,
@ -534,7 +534,7 @@ impl InnerConnection {
}
}
fn set_notice_handler(&mut self, handler: Box<NoticeHandler+Send>) -> Box<NoticeHandler+Send> {
fn set_notice_handler(&mut self, handler: Box<NoticeHandler>) -> Box<NoticeHandler> {
mem::replace(&mut self.notice_handler, handler)
}
@ -797,7 +797,7 @@ impl Connection {
}
/// Sets the notice handler for the connection, returning the old handler.
pub fn set_notice_handler(&self, handler: Box<NoticeHandler+Send>) -> Box<NoticeHandler+Send> {
pub fn set_notice_handler(&self, handler: Box<NoticeHandler>) -> Box<NoticeHandler> {
self.conn.borrow_mut().set_notice_handler(handler)
}

View File

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