Skip to content

Commit 613ceec

Browse files
committedMar 23, 2014
Updates for upstream changes
1 parent ec82c45 commit 613ceec

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed
 

‎src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<'conn > Iterator<PostgresNotification> for PostgresNotifications<'conn> {
246246
/// `next` may return `Some` notification after returning `None` if a new
247247
/// notification was received.
248248
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()
250250
}
251251
}
252252

‎src/message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl<R: Reader> ReadMessage for R {
263263
let ident = try!(self.read_u8());
264264
// subtract size of length value
265265
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)));
267267

268268
let ret = match ident as char {
269269
'1' => ParseComplete,
@@ -321,7 +321,7 @@ fn read_data_row(buf: &mut MemReader) -> IoResult<BackendMessage> {
321321
for _ in range(0, len) {
322322
let val = match try!(buf.read_be_i32()) {
323323
-1 => None,
324-
len => Some(try!(buf.read_bytes(len as uint)))
324+
len => Some(try!(buf.read_exact(len as uint)))
325325
};
326326
values.push(val);
327327
}
@@ -334,7 +334,7 @@ fn read_auth_message(buf: &mut MemReader) -> IoResult<BackendMessage> {
334334
0 => AuthenticationOk,
335335
2 => AuthenticationKerberosV5,
336336
3 => AuthenticationCleartextPassword,
337-
5 => AuthenticationMD5Password { salt: try!(buf.read_bytes(4)) },
337+
5 => AuthenticationMD5Password { salt: try!(buf.read_exact(4)) },
338338
6 => AuthenticationSCMCredential,
339339
7 => AuthenticationGSS,
340340
9 => AuthenticationSSPI,

‎src/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl Drop for PooledPostgresConnection {
125125
fn drop(&mut self) {
126126
let conn = RefCell::new(self.conn.take());
127127
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());
129129
})
130130
}
131131
}

‎src/types/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,13 @@ impl FromSql for Option<HashMap<~str, Option<~str>>> {
475475

476476
for _ in range(0, count) {
477477
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();
479479

480480
let val_len = or_fail!(rdr.read_be_i32());
481481
let val = if val_len < 0 {
482482
None
483483
} 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())
485485
};
486486

487487
map.insert(key, val);

0 commit comments

Comments
 (0)
Please sign in to comment.