4444
4545extern crate bufstream;
4646extern crate byteorder;
47+ extern crate fallible_iterator;
4748extern crate hex;
4849#[ macro_use]
4950extern crate log;
@@ -64,7 +65,7 @@ use postgres_protocol::message::frontend;
6465
6566use error:: { Error , ConnectError , SqlState , DbError } ;
6667use io:: TlsHandshake ;
67- use message:: { Backend , RowDescriptionEntry , ReadMessage } ;
68+ use message:: { Backend , RowDescriptionEntry } ;
6869use notification:: { Notifications , Notification } ;
6970use params:: { ConnectParams , IntoConnectParams , UserInfo } ;
7071use priv_io:: MessageStream ;
@@ -288,8 +289,8 @@ impl InnerConnection {
288289 loop {
289290 match try!( conn. read_message ( ) ) {
290291 Backend :: BackendKeyData { process_id, secret_key } => {
291- conn. cancel_data . process_id = process_id as i32 ;
292- conn. cancel_data . secret_key = secret_key as i32 ;
292+ conn. cancel_data . process_id = process_id;
293+ conn. cancel_data . secret_key = secret_key;
293294 }
294295 Backend :: ReadyForQuery { .. } => break ,
295296 Backend :: ErrorResponse { fields } => return DbError :: new_connect ( fields) ,
@@ -303,7 +304,7 @@ impl InnerConnection {
303304 fn read_message_with_notification ( & mut self ) -> std_io:: Result < Backend > {
304305 debug_assert ! ( !self . desynchronized) ;
305306 loop {
306- match try_desync ! ( self , ReadMessage :: read_message ( & mut self . stream) ) {
307+ match try_desync ! ( self , self . stream. read_message ( ) ) {
307308 Backend :: NoticeResponse { fields } => {
308309 if let Ok ( err) = DbError :: new_raw ( fields) {
309310 self . notice_handler . handle_notice ( err) ;
@@ -357,9 +358,9 @@ impl InnerConnection {
357358 fn read_message ( & mut self ) -> std_io:: Result < Backend > {
358359 loop {
359360 match try!( self . read_message_with_notification ( ) ) {
360- Backend :: NotificationResponse { pid , channel, payload } => {
361+ Backend :: NotificationResponse { process_id , channel, payload } => {
361362 self . notifications . push_back ( Notification {
362- pid : pid ,
363+ process_id : process_id ,
363364 channel : channel,
364365 payload : payload,
365366 } )
0 commit comments