@@ -14,7 +14,7 @@ use postgres::types::ToSql;
1414
1515struct Person {
1616 id: i32,
17- name: StrBuf ,
17+ name: String ,
1818 time_created: Timespec,
1919 data: Option<Vec<u8>>
2020}
@@ -206,7 +206,7 @@ pub type PostgresResult<T> = Result<T, PostgresError>;
206206#[ deriving( Clone ) ]
207207pub enum PostgresConnectTarget {
208208 /// Connect via TCP to the specified host.
209- TargetTcp ( StrBuf ) ,
209+ TargetTcp ( String ) ,
210210 /// Connect via a Unix domain socket in the specified directory.
211211 TargetUnix ( Path )
212212}
@@ -224,13 +224,13 @@ pub struct PostgresConnectParams {
224224 ///
225225 /// `PostgresConnection::connect` requires a user but `cancel_query` does
226226 /// not.
227- pub user : Option < StrBuf > ,
227+ pub user : Option < String > ,
228228 /// An optional password used for authentication
229- pub password : Option < StrBuf > ,
229+ pub password : Option < String > ,
230230 /// The database to connect to. Defaults the value of `user`.
231- pub database : Option < StrBuf > ,
231+ pub database : Option < String > ,
232232 /// Runtime parameters to be passed to the Postgres backend.
233- pub options : Vec < ( StrBuf , StrBuf ) > ,
233+ pub options : Vec < ( String , String ) > ,
234234}
235235
236236/// A trait implemented by types that can be converted into a
@@ -331,9 +331,9 @@ pub struct PostgresNotification {
331331 /// The process ID of the notifying backend process
332332 pub pid : i32 ,
333333 /// The name of the channel that the notify has been raised on
334- pub channel : StrBuf ,
334+ pub channel : String ,
335335 /// The "payload" string passed from the notifying process
336- pub payload : StrBuf ,
336+ pub payload : String ,
337337}
338338
339339/// An iterator over asynchronous notifications
@@ -413,7 +413,7 @@ struct InnerPostgresConnection {
413413 notice_handler : Box < PostgresNoticeHandler : Send > ,
414414 notifications : RingBuf < PostgresNotification > ,
415415 cancel_data : PostgresCancelData ,
416- unknown_types : HashMap < Oid , StrBuf > ,
416+ unknown_types : HashMap < Oid , String > ,
417417 desynchronized : bool ,
418418 finished : bool ,
419419 trans_depth : u32 ,
@@ -523,7 +523,7 @@ impl InnerPostgresConnection {
523523 }
524524 }
525525
526- fn handle_auth ( & mut self , user : StrBuf , pass : Option < StrBuf > )
526+ fn handle_auth ( & mut self , user : String , pass : Option < String > )
527527 -> Result < ( ) , PostgresConnectError > {
528528 match try_pg_conn ! ( self . read_message( ) ) {
529529 AuthenticationOk => return Ok ( ( ) ) ,
@@ -649,7 +649,7 @@ impl InnerPostgresConnection {
649649 Ok ( ( ) )
650650 }
651651
652- fn get_type_name ( & mut self , oid : Oid ) -> PostgresResult < StrBuf > {
652+ fn get_type_name ( & mut self , oid : Oid ) -> PostgresResult < String > {
653653 match self . unknown_types . find ( & oid) {
654654 Some ( name) => return Ok ( name. clone ( ) ) ,
655655 None => { }
@@ -677,7 +677,7 @@ impl InnerPostgresConnection {
677677 }
678678
679679 fn quick_query ( & mut self , query : & str )
680- -> PostgresResult < Vec < Vec < Option < StrBuf > > > > {
680+ -> PostgresResult < Vec < Vec < Option < String > > > > {
681681 check_desync ! ( self ) ;
682682 try_pg ! ( self . write_messages( [ Query { query: query } ] ) ) ;
683683
@@ -687,7 +687,7 @@ impl InnerPostgresConnection {
687687 ReadyForQuery { .. } => break ,
688688 DataRow { row } => {
689689 result. push ( row. move_iter ( ) . map ( |opt| {
690- opt. map ( |b| StrBuf :: from_utf8 ( b) . unwrap ( ) )
690+ opt. map ( |b| String :: from_utf8 ( b) . unwrap ( ) )
691691 } ) . collect ( ) ) ;
692692 }
693693 ErrorResponse { fields } => {
@@ -901,7 +901,7 @@ impl PostgresConnection {
901901 }
902902
903903 fn quick_query ( & self , query : & str )
904- -> PostgresResult < Vec < Vec < Option < StrBuf > > > > {
904+ -> PostgresResult < Vec < Vec < Option < String > > > > {
905905 self . conn . borrow_mut ( ) . quick_query ( query)
906906 }
907907
@@ -1045,7 +1045,7 @@ impl<'conn> PostgresTransaction<'conn> {
10451045/// A prepared statement
10461046pub struct PostgresStatement < ' conn > {
10471047 conn : & ' conn PostgresConnection ,
1048- name : StrBuf ,
1048+ name : String ,
10491049 param_types : Vec < PostgresType > ,
10501050 result_desc : Vec < ResultDescription > ,
10511051 next_portal_id : Cell < uint > ,
@@ -1244,15 +1244,15 @@ impl<'conn> PostgresStatement<'conn> {
12441244#[ deriving( Eq ) ]
12451245pub struct ResultDescription {
12461246 /// The name of the column
1247- pub name : StrBuf ,
1247+ pub name : String ,
12481248 /// The type of the data in the column
12491249 pub ty : PostgresType
12501250}
12511251
12521252/// An iterator over the resulting rows of a query.
12531253pub struct PostgresRows < ' stmt > {
12541254 stmt : & ' stmt PostgresStatement < ' stmt > ,
1255- name : StrBuf ,
1255+ name : String ,
12561256 data : RingBuf < Vec < Option < Vec < u8 > > > > ,
12571257 row_limit : uint ,
12581258 more_rows : bool ,
@@ -1416,7 +1416,7 @@ impl<'stmt, I: RowIndex+Clone+fmt::Show, T: FromSql> Index<I, T>
14161416 /// # let mut result = stmt.query([]).unwrap();
14171417 /// # let row = result.next().unwrap();
14181418 /// let foo: i32 = row[1];
1419- /// let bar: StrBuf = row["bar"];
1419+ /// let bar: String = row["bar"];
14201420 /// ```
14211421 fn index ( & self , idx : & I ) -> T {
14221422 match self . get ( idx. clone ( ) ) {
0 commit comments