@@ -8,24 +8,15 @@ pub enum Backend {
88 AuthenticationCleartextPassword ,
99 AuthenticationGSS ,
1010 AuthenticationKerberosV5 ,
11- AuthenticationMD5Password {
12- salt : [ u8 ; 4 ] ,
13- } ,
11+ AuthenticationMD5Password { salt : [ u8 ; 4 ] } ,
1412 AuthenticationOk ,
1513 AuthenticationSCMCredential ,
1614 AuthenticationSSPI ,
17- BackendKeyData {
18- process_id : i32 ,
19- secret_key : i32 ,
20- } ,
15+ BackendKeyData { process_id : i32 , secret_key : i32 } ,
2116 BindComplete ,
2217 CloseComplete ,
23- CommandComplete {
24- tag : String ,
25- } ,
26- CopyData {
27- data : Vec < u8 > ,
28- } ,
18+ CommandComplete { tag : String } ,
19+ CopyData { data : Vec < u8 > } ,
2920 CopyDone ,
3021 CopyInResponse {
3122 format : u8 ,
@@ -35,37 +26,22 @@ pub enum Backend {
3526 format : u8 ,
3627 column_formats : Vec < u16 > ,
3728 } ,
38- DataRow {
39- row : Vec < Option < Vec < u8 > > > ,
40- } ,
29+ DataRow { row : Vec < Option < Vec < u8 > > > } ,
4130 EmptyQueryResponse ,
42- ErrorResponse {
43- fields : Vec < ( u8 , String ) > ,
44- } ,
31+ ErrorResponse { fields : Vec < ( u8 , String ) > } ,
4532 NoData ,
46- NoticeResponse {
47- fields : Vec < ( u8 , String ) > ,
48- } ,
33+ NoticeResponse { fields : Vec < ( u8 , String ) > } ,
4934 NotificationResponse {
5035 process_id : i32 ,
5136 channel : String ,
5237 payload : String ,
5338 } ,
54- ParameterDescription {
55- types : Vec < Oid > ,
56- } ,
57- ParameterStatus {
58- parameter : String ,
59- value : String ,
60- } ,
39+ ParameterDescription { types : Vec < Oid > } ,
40+ ParameterStatus { parameter : String , value : String } ,
6141 ParseComplete ,
6242 PortalSuspended ,
63- ReadyForQuery {
64- _state : u8 ,
65- } ,
66- RowDescription {
67- descriptions : Vec < RowDescriptionEntry > ,
68- } ,
43+ ReadyForQuery { _state : u8 } ,
44+ RowDescription { descriptions : Vec < RowDescriptionEntry > , } ,
6945}
7046
7147impl Backend {
@@ -89,9 +65,7 @@ impl Backend {
8965 Message :: BindComplete => Backend :: BindComplete ,
9066 Message :: CloseComplete => Backend :: CloseComplete ,
9167 Message :: CommandComplete ( body) => {
92- Backend :: CommandComplete {
93- tag : body. tag ( ) . to_owned ( )
94- }
68+ Backend :: CommandComplete { tag : body. tag ( ) . to_owned ( ) }
9569 }
9670 Message :: CopyData ( body) => Backend :: CopyData { data : body. data ( ) . to_owned ( ) } ,
9771 Message :: CopyDone => Backend :: CopyDone ,
@@ -115,13 +89,17 @@ impl Backend {
11589 Message :: EmptyQueryResponse => Backend :: EmptyQueryResponse ,
11690 Message :: ErrorResponse ( body) => {
11791 Backend :: ErrorResponse {
118- fields : try!( body. fields ( ) . map ( |f| ( f. type_ ( ) , f. value ( ) . to_owned ( ) ) ) . collect ( ) ) ,
92+ fields : try!( body. fields ( )
93+ . map ( |f| ( f. type_ ( ) , f. value ( ) . to_owned ( ) ) )
94+ . collect ( ) ) ,
11995 }
12096 }
12197 Message :: NoData => Backend :: NoData ,
12298 Message :: NoticeResponse ( body) => {
12399 Backend :: NoticeResponse {
124- fields : try!( body. fields ( ) . map ( |f| ( f. type_ ( ) , f. value ( ) . to_owned ( ) ) ) . collect ( ) ) ,
100+ fields : try!( body. fields ( )
101+ . map ( |f| ( f. type_ ( ) , f. value ( ) . to_owned ( ) ) )
102+ . collect ( ) ) ,
125103 }
126104 }
127105 Message :: NotificationResponse ( body) => {
@@ -132,9 +110,7 @@ impl Backend {
132110 }
133111 }
134112 Message :: ParameterDescription ( body) => {
135- Backend :: ParameterDescription {
136- types : try!( body. parameters ( ) . collect ( ) ) ,
137- }
113+ Backend :: ParameterDescription { types : try!( body. parameters ( ) . collect ( ) ) }
138114 }
139115 Message :: ParameterStatus ( body) => {
140116 Backend :: ParameterStatus {
@@ -158,9 +134,7 @@ impl Backend {
158134 format : f. format ( ) ,
159135 }
160136 } ) ;
161- Backend :: RowDescription {
162- descriptions : try!( fields. collect ( ) ) ,
163- }
137+ Backend :: RowDescription { descriptions : try!( fields. collect ( ) ) }
164138 }
165139 _ => return Err ( io:: Error :: new ( io:: ErrorKind :: InvalidInput , "unknown message type" ) ) ,
166140 } ;
0 commit comments