Skip to content

Commit 9ae7b13

Browse files
committed
Fix deprecation warnings
1 parent 7479bc7 commit 9ae7b13

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/error.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -481,30 +481,30 @@ impl DbError {
481481
pub fn new_raw(fields: Vec<(u8, String)>) -> result::Result<DbError, ()> {
482482
let mut map: HashMap<_, _> = fields.into_iter().collect();
483483
Ok(DbError {
484-
severity: try!(map.pop(&b'S').ok_or(())),
485-
code: SqlState::from_code(try!(map.pop(&b'C').ok_or(()))[]),
486-
message: try!(map.pop(&b'M').ok_or(())),
487-
detail: map.pop(&b'D'),
488-
hint: map.pop(&b'H'),
489-
position: match map.pop(&b'P') {
484+
severity: try!(map.remove(&b'S').ok_or(())),
485+
code: SqlState::from_code(try!(map.remove(&b'C').ok_or(()))[]),
486+
message: try!(map.remove(&b'M').ok_or(())),
487+
detail: map.remove(&b'D'),
488+
hint: map.remove(&b'H'),
489+
position: match map.remove(&b'P') {
490490
Some(pos) => Some(ErrorPosition::Normal(try!(from_str(pos[]).ok_or(())))),
491-
None => match map.pop(&b'p') {
491+
None => match map.remove(&b'p') {
492492
Some(pos) => Some(ErrorPosition::Internal {
493493
position: try!(from_str(pos[]).ok_or(())),
494-
query: try!(map.pop(&b'q').ok_or(()))
494+
query: try!(map.remove(&b'q').ok_or(()))
495495
}),
496496
None => None
497497
}
498498
},
499-
where_: map.pop(&b'W'),
500-
schema: map.pop(&b's'),
501-
table: map.pop(&b't'),
502-
column: map.pop(&b'c'),
503-
datatype: map.pop(&b'd'),
504-
constraint: map.pop(&b'n'),
505-
file: try!(map.pop(&b'F').ok_or(())),
506-
line: try!(map.pop(&b'L').and_then(|l| from_str(l[])).ok_or(())),
507-
routine: try!(map.pop(&b'R').ok_or(())),
499+
where_: map.remove(&b'W'),
500+
schema: map.remove(&b's'),
501+
table: map.remove(&b't'),
502+
column: map.remove(&b'c'),
503+
datatype: map.remove(&b'd'),
504+
constraint: map.remove(&b'n'),
505+
file: try!(map.remove(&b'F').ok_or(())),
506+
line: try!(map.remove(&b'L').and_then(|l| from_str(l[])).ok_or(())),
507+
routine: try!(map.remove(&b'R').ok_or(())),
508508
})
509509
}
510510

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl InnerConnection {
402402
}
403403
}
404404
NotificationResponse { pid, channel, payload } => {
405-
self.notifications.push(Notification {
405+
self.notifications.push_back(Notification {
406406
pid: pid,
407407
channel: channel,
408408
payload: payload
@@ -591,7 +591,7 @@ impl InnerConnection {
591591
}
592592

593593
fn get_type_name(&mut self, oid: Oid) -> Result<String> {
594-
if let Some(name) = self.unknown_types.find(&oid) {
594+
if let Some(name) = self.unknown_types.get(&oid) {
595595
return Ok(name.clone());
596596
}
597597
let name = try!(self.quick_query(format!("SELECT typname FROM pg_type \
@@ -1321,7 +1321,7 @@ impl<'stmt> Rows<'stmt> {
13211321
self.more_rows = true;
13221322
break;
13231323
},
1324-
DataRow { row } => self.data.push(row),
1324+
DataRow { row } => self.data.push_back(row),
13251325
ErrorResponse { fields } => {
13261326
try!(conn.wait_for_ready());
13271327
return DbError::new(fields);

0 commit comments

Comments
 (0)