@@ -11,7 +11,6 @@ use types::{SessionInfo, Type, ToSql};
11
11
use message:: FrontendMessage :: * ;
12
12
use message:: BackendMessage :: * ;
13
13
use message:: WriteMessage ;
14
- use util;
15
14
use rows:: { Rows , LazyRows } ;
16
15
use { bad_response, Connection , Transaction , StatementInternals , Result , RowsNew , InnerConnection ,
17
16
SessionInfoNew , LazyRowsNew , DbErrorNew , ColumnNew , StatementInfo , TransactionInternals } ;
@@ -140,7 +139,7 @@ impl<'conn> Statement<'conn> {
140
139
return DbError :: new ( fields) ;
141
140
}
142
141
CommandComplete { tag } => {
143
- num = util :: parse_update_count ( tag) ;
142
+ num = parse_update_count ( tag) ;
144
143
break ;
145
144
}
146
145
EmptyQueryResponse => {
@@ -321,7 +320,7 @@ impl<'conn> Statement<'conn> {
321
320
try!( info. conn . write_messages ( & [ CopyDone , Sync ] ) ) ;
322
321
323
322
let num = match try!( info. conn . read_message ( ) ) {
324
- CommandComplete { tag } => util :: parse_update_count ( tag) ,
323
+ CommandComplete { tag } => parse_update_count ( tag) ,
325
324
ErrorResponse { fields } => {
326
325
try!( info. conn . wait_for_ready ( ) ) ;
327
326
return DbError :: new ( fields) ;
@@ -421,7 +420,7 @@ impl<'conn> Statement<'conn> {
421
420
}
422
421
BCopyDone => { }
423
422
CommandComplete { tag } => {
424
- count = util :: parse_update_count ( tag) ;
423
+ count = parse_update_count ( tag) ;
425
424
break ;
426
425
}
427
426
ErrorResponse { fields } => {
@@ -567,3 +566,7 @@ impl Format {
567
566
}
568
567
}
569
568
}
569
+
570
+ fn parse_update_count ( tag : String ) -> u64 {
571
+ tag. split ( ' ' ) . last ( ) . unwrap ( ) . parse ( ) . unwrap_or ( 0 )
572
+ }
0 commit comments