Skip to content

Commit f49cfe3

Browse files
committed
Move parse_update_count and delete util
1 parent 16bc4b9 commit f49cfe3

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ mod md5;
9393
mod message;
9494
mod priv_io;
9595
mod url;
96-
mod util;
9796
pub mod error;
9897
pub mod io;
9998
pub mod notification;

src/stmt.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use types::{SessionInfo, Type, ToSql};
1111
use message::FrontendMessage::*;
1212
use message::BackendMessage::*;
1313
use message::WriteMessage;
14-
use util;
1514
use rows::{Rows, LazyRows};
1615
use {bad_response, Connection, Transaction, StatementInternals, Result, RowsNew, InnerConnection,
1716
SessionInfoNew, LazyRowsNew, DbErrorNew, ColumnNew, StatementInfo, TransactionInternals};
@@ -140,7 +139,7 @@ impl<'conn> Statement<'conn> {
140139
return DbError::new(fields);
141140
}
142141
CommandComplete { tag } => {
143-
num = util::parse_update_count(tag);
142+
num = parse_update_count(tag);
144143
break;
145144
}
146145
EmptyQueryResponse => {
@@ -321,7 +320,7 @@ impl<'conn> Statement<'conn> {
321320
try!(info.conn.write_messages(&[CopyDone, Sync]));
322321

323322
let num = match try!(info.conn.read_message()) {
324-
CommandComplete { tag } => util::parse_update_count(tag),
323+
CommandComplete { tag } => parse_update_count(tag),
325324
ErrorResponse { fields } => {
326325
try!(info.conn.wait_for_ready());
327326
return DbError::new(fields);
@@ -421,7 +420,7 @@ impl<'conn> Statement<'conn> {
421420
}
422421
BCopyDone => {}
423422
CommandComplete { tag } => {
424-
count = util::parse_update_count(tag);
423+
count = parse_update_count(tag);
425424
break;
426425
}
427426
ErrorResponse { fields } => {
@@ -567,3 +566,7 @@ impl Format {
567566
}
568567
}
569568
}
569+
570+
fn parse_update_count(tag: String) -> u64 {
571+
tag.split(' ').last().unwrap().parse().unwrap_or(0)
572+
}

src/util.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)