@@ -224,8 +224,8 @@ impl IntoConnectParams for Url {
224224 ..
225225 } = self ;
226226
227- let maybe_path = try!( url:: decode_component ( host. as_slice ( ) ) . map_err ( InvalidUrl ) ) ;
228- let target = if maybe_path. as_slice ( ) . starts_with ( "/" ) {
227+ let maybe_path = try!( url:: decode_component ( host[ ] ) . map_err ( InvalidUrl ) ) ;
228+ let target = if maybe_path[ ] . starts_with ( "/" ) {
229229 TargetUnix ( Path :: new ( maybe_path) )
230230 } else {
231231 TargetTcp ( host)
@@ -238,7 +238,7 @@ impl IntoConnectParams for Url {
238238
239239 let database = if !path. is_empty ( ) {
240240 // path contains the leading /
241- let ( _, path) = path. as_slice ( ) . slice_shift_char ( ) ;
241+ let ( _, path) = path[ ] . slice_shift_char ( ) ;
242242 Some ( path. to_string ( ) )
243243 } else {
244244 None
@@ -413,7 +413,7 @@ impl InnerPostgresConnection {
413413
414414 try_pg_conn ! ( conn. write_messages( [ StartupMessage {
415415 version: message:: PROTOCOL_VERSION ,
416- parameters: options. as_slice ( )
416+ parameters: options[ ]
417417 } ] ) ) ;
418418
419419 try!( conn. handle_auth ( user) ) ;
@@ -476,7 +476,7 @@ impl InnerPostgresConnection {
476476 None => return Err ( MissingPassword )
477477 } ;
478478 try_pg_conn ! ( self . write_messages( [ PasswordMessage {
479- password: pass. as_slice ( ) ,
479+ password: pass[ ] ,
480480 } ] ) ) ;
481481 }
482482 AuthenticationMD5Password { salt } => {
@@ -487,14 +487,14 @@ impl InnerPostgresConnection {
487487 let hasher = Hasher :: new ( MD5 ) ;
488488 hasher. update ( pass. as_bytes ( ) ) ;
489489 hasher. update ( user. user . as_bytes ( ) ) ;
490- let output = hasher. final ( ) . as_slice ( ) . to_hex ( ) ;
490+ let output = hasher. final ( ) [ ] . to_hex ( ) ;
491491 let hasher = Hasher :: new ( MD5 ) ;
492492 hasher. update ( output. as_bytes ( ) ) ;
493493 hasher. update ( salt) ;
494494 let output = format ! ( "md5{}" ,
495- hasher. final( ) . as_slice ( ) . to_hex( ) ) ;
495+ hasher. final( ) [ ] . to_hex( ) ) ;
496496 try_pg_conn ! ( self . write_messages( [ PasswordMessage {
497- password: output. as_slice ( )
497+ password: output[ ]
498498 } ] ) ) ;
499499 }
500500 AuthenticationKerberosV5
@@ -530,13 +530,13 @@ impl InnerPostgresConnection {
530530
531531 try_pg ! ( self . write_messages( [
532532 Parse {
533- name: stmt_name. as_slice ( ) ,
533+ name: stmt_name[ ] ,
534534 query: query,
535535 param_types: [ ]
536536 } ,
537537 Describe {
538538 variant: b'S' ,
539- name: stmt_name. as_slice ( ) ,
539+ name: stmt_name[ ] ,
540540 } ,
541541 Sync ] ) ) ;
542542
@@ -598,17 +598,17 @@ impl InnerPostgresConnection {
598598 let _ = util:: comma_join ( & mut query, rows. iter ( ) . map ( |& e| e) ) ;
599599 let _ = write ! ( query, " FROM {}" , table) ;
600600 let query = String :: from_utf8 ( query. unwrap ( ) ) . unwrap ( ) ;
601- let ( stmt_name, _, result_desc) = try!( self . raw_prepare ( query. as_slice ( ) ) ) ;
601+ let ( stmt_name, _, result_desc) = try!( self . raw_prepare ( query[ ] ) ) ;
602602
603603 let column_types = result_desc. iter ( ) . map ( |desc| desc. ty . clone ( ) ) . collect ( ) ;
604- try!( self . close_statement ( stmt_name. as_slice ( ) ) ) ;
604+ try!( self . close_statement ( stmt_name[ ] ) ) ;
605605
606606 let mut query = MemWriter :: new ( ) ;
607607 let _ = write ! ( query, "COPY {} (" , table) ;
608608 let _ = util:: comma_join ( & mut query, rows. iter ( ) . map ( |& e| e) ) ;
609609 let _ = write ! ( query, ") FROM STDIN WITH (FORMAT binary)" ) ;
610610 let query = String :: from_utf8 ( query. unwrap ( ) ) . unwrap ( ) ;
611- let ( stmt_name, _, _) = try!( self . raw_prepare ( query. as_slice ( ) ) ) ;
611+ let ( stmt_name, _, _) = try!( self . raw_prepare ( query[ ] ) ) ;
612612
613613 Ok ( PostgresCopyInStatement {
614614 conn : conn,
@@ -656,7 +656,7 @@ impl InnerPostgresConnection {
656656 None => { }
657657 }
658658 let name = try!( self . quick_query ( format ! ( "SELECT typname FROM pg_type \
659- WHERE oid={}", oid) . as_slice ( ) ) )
659+ WHERE oid={}", oid) [ ] ) )
660660 . into_iter ( ) . next ( ) . unwrap ( ) . into_iter ( ) . next ( ) . unwrap ( ) . unwrap ( ) ;
661661 self . unknown_types . insert ( oid, name. clone ( ) ) ;
662662 Ok ( name)
@@ -687,7 +687,7 @@ impl InnerPostgresConnection {
687687 ReadyForQuery { .. } => break ,
688688 DataRow { row } => {
689689 result. push ( row. into_iter ( ) . map ( |opt| {
690- opt. map ( |b| String :: from_utf8_lossy ( b. as_slice ( ) ) . into_string ( ) )
690+ opt. map ( |b| String :: from_utf8_lossy ( b[ ] ) . into_string ( ) )
691691 } ) . collect ( ) ) ;
692692 }
693693 ErrorResponse { fields } => {
@@ -1149,7 +1149,7 @@ impl<'conn> PostgresStatement<'conn> {
11491149 fn finish_inner ( & mut self ) -> PostgresResult < ( ) > {
11501150 let mut conn = self . conn . conn . borrow_mut ( ) ;
11511151 check_desync ! ( conn) ;
1152- conn. close_statement ( self . name . as_slice ( ) )
1152+ conn. close_statement ( self . name [ ] )
11531153 }
11541154
11551155 fn inner_execute ( & self , portal_name : & str , row_limit : i32 , params : & [ & ToSql ] )
@@ -1170,9 +1170,9 @@ impl<'conn> PostgresStatement<'conn> {
11701170 try_pg ! ( conn. write_messages( [
11711171 Bind {
11721172 portal: portal_name,
1173- statement: self . name. as_slice ( ) ,
1173+ statement: self . name[ ] ,
11741174 formats: [ 1 ] ,
1175- values: values. as_slice ( ) ,
1175+ values: values[ ] ,
11761176 result_formats: [ 1 ]
11771177 } ,
11781178 Execute {
@@ -1200,7 +1200,7 @@ impl<'conn> PostgresStatement<'conn> {
12001200 self . next_portal_id . set ( id + 1 ) ;
12011201 let portal_name = format ! ( "{}p{}" , self . name, id) ;
12021202
1203- try!( self . inner_execute ( portal_name. as_slice ( ) , row_limit, params) ) ;
1203+ try!( self . inner_execute ( portal_name[ ] , row_limit, params) ) ;
12041204
12051205 let mut result = PostgresRows {
12061206 stmt : self ,
@@ -1217,12 +1217,12 @@ impl<'conn> PostgresStatement<'conn> {
12171217
12181218 /// Returns a slice containing the expected parameter types.
12191219 pub fn param_types ( & self ) -> & [ PostgresType ] {
1220- self . param_types . as_slice ( )
1220+ self . param_types [ ]
12211221 }
12221222
12231223 /// Returns a slice describing the columns of the result of the query.
12241224 pub fn result_descriptions ( & self ) -> & [ ResultDescription ] {
1225- self . result_desc . as_slice ( )
1225+ self . result_desc [ ]
12261226 }
12271227
12281228 /// Executes the prepared statement, returning the number of rows modified.
@@ -1349,7 +1349,7 @@ impl<'stmt> PostgresRows<'stmt> {
13491349 try_pg ! ( conn. write_messages( [
13501350 Close {
13511351 variant: b'P' ,
1352- name: self . name. as_slice ( )
1352+ name: self . name[ ]
13531353 } ,
13541354 Sync ] ) ) ;
13551355
@@ -1404,7 +1404,7 @@ impl<'stmt> PostgresRows<'stmt> {
14041404 fn execute ( & mut self ) -> PostgresResult < ( ) > {
14051405 try_pg ! ( self . stmt. conn. write_messages( [
14061406 Execute {
1407- portal: self . name. as_slice ( ) ,
1407+ portal: self . name[ ] ,
14081408 max_rows: self . row_limit
14091409 } ,
14101410 Sync ] ) ) ;
@@ -1535,7 +1535,7 @@ impl RowIndex for uint {
15351535impl < ' a > RowIndex for & ' a str {
15361536 #[ inline]
15371537 fn idx ( & self , stmt : & PostgresStatement ) -> Option < uint > {
1538- stmt. result_descriptions ( ) . iter ( ) . position ( |d| d. name . as_slice ( ) == * self )
1538+ stmt. result_descriptions ( ) . iter ( ) . position ( |d| d. name [ ] == * self )
15391539 }
15401540}
15411541
@@ -1587,12 +1587,12 @@ impl<'a> PostgresCopyInStatement<'a> {
15871587 fn finish_inner ( & mut self ) -> PostgresResult < ( ) > {
15881588 let mut conn = self . conn . conn . borrow_mut ( ) ;
15891589 check_desync ! ( conn) ;
1590- conn. close_statement ( self . name . as_slice ( ) )
1590+ conn. close_statement ( self . name [ ] )
15911591 }
15921592
15931593 /// Returns a slice containing the expected column types.
15941594 pub fn column_types ( & self ) -> & [ PostgresType ] {
1595- self . column_types . as_slice ( )
1595+ self . column_types [ ]
15961596 }
15971597
15981598 /// Executes the prepared statement.
@@ -1608,7 +1608,7 @@ impl<'a> PostgresCopyInStatement<'a> {
16081608 try_pg ! ( conn. write_messages( [
16091609 Bind {
16101610 portal: "" ,
1611- statement: self . name. as_slice ( ) ,
1611+ statement: self . name[ ] ,
16121612 formats: [ ] ,
16131613 values: [ ] ,
16141614 result_formats: [ ]
@@ -1657,7 +1657,7 @@ impl<'a> PostgresCopyInStatement<'a> {
16571657 }
16581658 Some ( val) => {
16591659 let _ = buf. write_be_i32 ( val. len ( ) as i32 ) ;
1660- let _ = buf. write ( val. as_slice ( ) ) ;
1660+ let _ = buf. write ( val[ ] ) ;
16611661 }
16621662 }
16631663 }
@@ -1674,15 +1674,15 @@ impl<'a> PostgresCopyInStatement<'a> {
16741674
16751675 try_pg_desync ! ( conn, conn. stream. write_message(
16761676 & CopyData {
1677- data: buf. unwrap( ) . as_slice ( )
1677+ data: buf. unwrap( ) [ ]
16781678 } ) ) ;
16791679 buf = MemWriter :: new ( ) ;
16801680 }
16811681
16821682 let _ = buf. write_be_i16 ( -1 ) ;
16831683 try_pg ! ( conn. write_messages( [
16841684 CopyData {
1685- data: buf. unwrap( ) . as_slice ( ) ,
1685+ data: buf. unwrap( ) [ ] ,
16861686 } ,
16871687 CopyDone ,
16881688 Sync ] ) ) ;
0 commit comments