File tree Expand file tree Collapse file tree 4 files changed +2
-35
lines changed Expand file tree Collapse file tree 4 files changed +2
-35
lines changed Original file line number Diff line number Diff line change @@ -603,11 +603,6 @@ pub mod raw {
603
603
from_utf8_owned ( vec ! [ u] )
604
604
}
605
605
606
- /// Sets the length of a string
607
- ///
608
- /// This will explicitly set the size of the string, without actually
609
- /// modifying its buffers, so it is up to the caller to ensure that
610
- /// the string is actually the specified size.
611
606
#[ test]
612
607
fn test_from_buf_len ( ) {
613
608
use slice:: ImmutableVector ;
@@ -785,30 +780,6 @@ impl<'a> StrAllocating for &'a str {
785
780
}
786
781
}
787
782
788
- /// Methods for owned strings
789
- pub trait OwnedStr {
790
- /// Consumes the string, returning the underlying byte buffer.
791
- ///
792
- /// The buffer does not have a null terminator.
793
- fn into_bytes ( self ) -> Vec < u8 > ;
794
-
795
- /// Pushes the given string onto this string, returning the concatenation of the two strings.
796
- fn append ( self , rhs : & str ) -> String ;
797
- }
798
-
799
- impl OwnedStr for String {
800
- #[ inline]
801
- fn into_bytes ( self ) -> Vec < u8 > {
802
- unsafe { mem:: transmute ( self ) }
803
- }
804
-
805
- #[ inline]
806
- fn append ( mut self , rhs : & str ) -> String {
807
- self . push_str ( rhs) ;
808
- self
809
- }
810
- }
811
-
812
783
#[ cfg( test) ]
813
784
mod tests {
814
785
use std:: iter:: AdditiveIterator ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use iter::Iterator;
20
20
use mem;
21
21
use option:: { Option , Some , None } ;
22
22
use slice:: { ImmutableVector , MutableVector , Vector } ;
23
- use str:: { OwnedStr , Str , StrAllocating , StrSlice } ;
23
+ use str:: { Str , StrAllocating , StrSlice } ;
24
24
use string:: String ;
25
25
use to_string:: IntoStr ;
26
26
use vec:: Vec ;
Original file line number Diff line number Diff line change @@ -56,8 +56,6 @@ use vec::Vec;
56
56
use c_str:: ToCStr ;
57
57
#[ cfg( unix) ]
58
58
use libc:: c_char;
59
- #[ cfg( windows) ]
60
- use str:: OwnedStr ;
61
59
62
60
/// Get the number of cores available
63
61
pub fn num_cpus ( ) -> uint {
@@ -708,8 +706,6 @@ pub fn self_exe_name() -> Option<Path> {
708
706
709
707
#[ cfg( windows) ]
710
708
fn load_self ( ) -> Option < Vec < u8 > > {
711
- use str:: OwnedStr ;
712
-
713
709
unsafe {
714
710
use os:: win32:: fill_utf16_buf_and_decode;
715
711
fill_utf16_buf_and_decode ( |buf, sz| {
Original file line number Diff line number Diff line change 76
76
#[ doc( no_inline) ] pub use path:: { GenericPath , Path , PosixPath , WindowsPath } ;
77
77
#[ doc( no_inline) ] pub use ptr:: RawPtr ;
78
78
#[ doc( no_inline) ] pub use io:: { Buffer , Writer , Reader , Seek } ;
79
- #[ doc( no_inline) ] pub use str:: { Str , StrVector , StrSlice , OwnedStr } ;
79
+ #[ doc( no_inline) ] pub use str:: { Str , StrVector , StrSlice } ;
80
80
#[ doc( no_inline) ] pub use str:: { IntoMaybeOwned , StrAllocating , UnicodeStrSlice } ;
81
81
#[ doc( no_inline) ] pub use to_string:: { ToString , IntoStr } ;
82
82
#[ doc( no_inline) ] pub use tuple:: { Tuple1 , Tuple2 , Tuple3 , Tuple4 } ;
You can’t perform that action at this time.
0 commit comments