File tree 4 files changed +7
-7
lines changed 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ impl<'conn > Iterator<PostgresNotification> for PostgresNotifications<'conn> {
246
246
/// `next` may return `Some` notification after returning `None` if a new
247
247
/// notification was received.
248
248
fn next ( & mut self ) -> Option < PostgresNotification > {
249
- self . conn . conn . with_mut ( |conn| { conn . notifications . pop_front ( ) } )
249
+ self . conn . conn . borrow_mut ( ) . notifications . pop_front ( )
250
250
}
251
251
}
252
252
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ impl<R: Reader> ReadMessage for R {
263
263
let ident = try!( self . read_u8 ( ) ) ;
264
264
// subtract size of length value
265
265
let len = try!( self . read_be_i32 ( ) ) as uint - mem:: size_of :: < i32 > ( ) ;
266
- let mut buf = MemReader :: new ( try!( self . read_bytes ( len) ) ) ;
266
+ let mut buf = MemReader :: new ( try!( self . read_exact ( len) ) ) ;
267
267
268
268
let ret = match ident as char {
269
269
'1' => ParseComplete ,
@@ -321,7 +321,7 @@ fn read_data_row(buf: &mut MemReader) -> IoResult<BackendMessage> {
321
321
for _ in range ( 0 , len) {
322
322
let val = match try!( buf. read_be_i32 ( ) ) {
323
323
-1 => None ,
324
- len => Some ( try!( buf. read_bytes ( len as uint ) ) )
324
+ len => Some ( try!( buf. read_exact ( len as uint ) ) )
325
325
} ;
326
326
values. push ( val) ;
327
327
}
@@ -334,7 +334,7 @@ fn read_auth_message(buf: &mut MemReader) -> IoResult<BackendMessage> {
334
334
0 => AuthenticationOk ,
335
335
2 => AuthenticationKerberosV5 ,
336
336
3 => AuthenticationCleartextPassword ,
337
- 5 => AuthenticationMD5Password { salt : try!( buf. read_bytes ( 4 ) ) } ,
337
+ 5 => AuthenticationMD5Password { salt : try!( buf. read_exact ( 4 ) ) } ,
338
338
6 => AuthenticationSCMCredential ,
339
339
7 => AuthenticationGSS ,
340
340
9 => AuthenticationSSPI ,
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ impl Drop for PooledPostgresConnection {
125
125
fn drop ( & mut self ) {
126
126
let conn = RefCell :: new ( self . conn . take ( ) ) ;
127
127
self . pool . pool . access ( |pool| {
128
- pool. pool . push ( conn. with_mut ( |r| r . take_unwrap ( ) ) ) ;
128
+ pool. pool . push ( conn. borrow_mut ( ) . take_unwrap ( ) ) ;
129
129
} )
130
130
}
131
131
}
Original file line number Diff line number Diff line change @@ -475,13 +475,13 @@ impl FromSql for Option<HashMap<~str, Option<~str>>> {
475
475
476
476
for _ in range ( 0 , count) {
477
477
let key_len = or_fail ! ( rdr. read_be_i32( ) ) ;
478
- let key = str:: from_utf8_owned ( or_fail ! ( rdr. read_bytes ( key_len as uint) ) ) . unwrap ( ) ;
478
+ let key = str:: from_utf8_owned ( or_fail ! ( rdr. read_exact ( key_len as uint) ) ) . unwrap ( ) ;
479
479
480
480
let val_len = or_fail ! ( rdr. read_be_i32( ) ) ;
481
481
let val = if val_len < 0 {
482
482
None
483
483
} else {
484
- Some ( str:: from_utf8_owned ( or_fail ! ( rdr. read_bytes ( val_len as uint) ) ) . unwrap ( ) )
484
+ Some ( str:: from_utf8_owned ( or_fail ! ( rdr. read_exact ( val_len as uint) ) ) . unwrap ( ) )
485
485
} ;
486
486
487
487
map. insert ( key, val) ;
You can’t perform that action at this time.
0 commit comments