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 @@ -601,11 +601,6 @@ pub mod raw {
601
601
from_utf8_owned ( vec ! [ u] )
602
602
}
603
603
604
- /// Sets the length of a string
605
- ///
606
- /// This will explicitly set the size of the string, without actually
607
- /// modifying its buffers, so it is up to the caller to ensure that
608
- /// the string is actually the specified size.
609
604
#[ test]
610
605
fn test_from_buf_len ( ) {
611
606
use slice:: ImmutableVector ;
@@ -783,30 +778,6 @@ impl<'a> StrAllocating for &'a str {
783
778
}
784
779
}
785
780
786
- /// Methods for owned strings
787
- pub trait OwnedStr {
788
- /// Consumes the string, returning the underlying byte buffer.
789
- ///
790
- /// The buffer does not have a null terminator.
791
- fn into_bytes ( self ) -> Vec < u8 > ;
792
-
793
- /// Pushes the given string onto this string, returning the concatenation of the two strings.
794
- fn append ( self , rhs : & str ) -> String ;
795
- }
796
-
797
- impl OwnedStr for String {
798
- #[ inline]
799
- fn into_bytes ( self ) -> Vec < u8 > {
800
- unsafe { mem:: transmute ( self ) }
801
- }
802
-
803
- #[ inline]
804
- fn append ( mut self , rhs : & str ) -> String {
805
- self . push_str ( rhs) ;
806
- self
807
- }
808
- }
809
-
810
781
#[ cfg( test) ]
811
782
mod tests {
812
783
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