@@ -87,7 +87,6 @@ use std::from_str::FromStr;
8787use std:: io:: { BufferedStream , IoResult } ;
8888use std:: io:: net:: ip:: Port ;
8989use std:: mem;
90- use std:: owned:: Box ;
9190use std:: task;
9291use std:: fmt;
9392
@@ -107,8 +106,7 @@ use error::{InvalidUrl,
107106 UnsupportedAuthentication ,
108107 PgWrongConnection ,
109108 PgWrongTransaction } ;
110- use io:: { MaybeSslStream ,
111- InternalStream } ;
109+ use io:: { MaybeSslStream , InternalStream } ;
112110use message:: { AuthenticationCleartextPassword ,
113111 AuthenticationGSS ,
114112 AuthenticationKerberosV5 ,
@@ -435,19 +433,6 @@ impl InnerPostgresConnection {
435433 let params = try!( params. into_connect_params ( ) ) ;
436434 let stream = try!( io:: initialize_stream ( & params, ssl) ) ;
437435
438- let mut conn = InnerPostgresConnection {
439- stream : BufferedStream :: new ( stream) ,
440- next_stmt_id : 0 ,
441- notice_handler : box DefaultNoticeHandler ,
442- notifications : RingBuf :: new ( ) ,
443- cancel_data : PostgresCancelData { process_id : 0 , secret_key : 0 } ,
444- unknown_types : HashMap :: new ( ) ,
445- desynchronized : false ,
446- finished : false ,
447- trans_depth : 0 ,
448- canary : CANARY ,
449- } ;
450-
451436 let PostgresConnectParams {
452437 user,
453438 password,
@@ -461,6 +446,19 @@ impl InnerPostgresConnection {
461446 None => return Err ( MissingUser ) ,
462447 } ;
463448
449+ let mut conn = InnerPostgresConnection {
450+ stream : BufferedStream :: new ( stream) ,
451+ next_stmt_id : 0 ,
452+ notice_handler : box DefaultNoticeHandler ,
453+ notifications : RingBuf :: new ( ) ,
454+ cancel_data : PostgresCancelData { process_id : 0 , secret_key : 0 } ,
455+ unknown_types : HashMap :: new ( ) ,
456+ desynchronized : false ,
457+ finished : false ,
458+ trans_depth : 0 ,
459+ canary : CANARY ,
460+ } ;
461+
464462 options. push ( ( "client_encoding" . to_owned ( ) , "UTF8" . to_owned ( ) ) ) ;
465463 // Postgres uses the value of TimeZone as the time zone for TIMESTAMP
466464 // WITH TIME ZONE values. Timespec converts to GMT internally.
0 commit comments