@@ -11,7 +11,6 @@ use types::{SessionInfo, Type, ToSql};
1111use message:: FrontendMessage :: * ;
1212use message:: BackendMessage :: * ;
1313use message:: WriteMessage ;
14- use util;
1514use rows:: { Rows , LazyRows } ;
1615use { 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+ }
0 commit comments