@@ -42,7 +42,7 @@ const UTF8_REPLACEMENT_CHARACTER: &str = "\u{FFFD}";
4242/// which represents a Unicode scalar value:
4343/// a code point that is not a surrogate (U+D800 to U+DFFF).
4444#[ derive( Eq , PartialEq , Ord , PartialOrd , Clone , Copy ) ]
45- pub struct CodePoint {
45+ pub ( crate ) struct CodePoint {
4646 value : u32 ,
4747}
4848
@@ -133,7 +133,7 @@ impl CodePoint {
133133/// Similar to `String`, but can additionally contain surrogate code points
134134/// if they’re not in a surrogate pair.
135135#[ derive( Eq , PartialEq , Ord , PartialOrd , Clone ) ]
136- pub struct Wtf8Buf {
136+ pub ( crate ) struct Wtf8Buf {
137137 bytes : Vec < u8 > ,
138138
139139 /// Do we know that `bytes` holds a valid UTF-8 encoding? We can easily
@@ -496,7 +496,7 @@ impl Extend<CodePoint> for Wtf8Buf {
496496/// Similar to `&str`, but can additionally contain surrogate code points
497497/// if they’re not in a surrogate pair.
498498#[ derive( Eq , Ord , PartialEq , PartialOrd ) ]
499- pub struct Wtf8 {
499+ pub ( crate ) struct Wtf8 {
500500 bytes : [ u8 ] ,
501501}
502502
@@ -869,7 +869,7 @@ fn decode_surrogate_pair(lead: u16, trail: u16) -> char {
869869
870870/// Copied from core::str::StrPrelude::is_char_boundary
871871#[ inline]
872- pub fn is_code_point_boundary ( slice : & Wtf8 , index : usize ) -> bool {
872+ pub ( crate ) fn is_code_point_boundary ( slice : & Wtf8 , index : usize ) -> bool {
873873 if index == slice. len ( ) {
874874 return true ;
875875 }
@@ -881,14 +881,14 @@ pub fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool {
881881
882882/// Copied from core::str::raw::slice_unchecked
883883#[ inline]
884- pub unsafe fn slice_unchecked ( s : & Wtf8 , begin : usize , end : usize ) -> & Wtf8 {
884+ pub ( crate ) unsafe fn slice_unchecked ( s : & Wtf8 , begin : usize , end : usize ) -> & Wtf8 {
885885 // memory layout of a &[u8] and &Wtf8 are the same
886886 Wtf8 :: from_bytes_unchecked ( slice:: from_raw_parts ( s. bytes . as_ptr ( ) . add ( begin) , end - begin) )
887887}
888888
889889/// Copied from core::str::raw::slice_error_fail
890890#[ inline( never) ]
891- pub fn slice_error_fail ( s : & Wtf8 , begin : usize , end : usize ) -> ! {
891+ pub ( crate ) fn slice_error_fail ( s : & Wtf8 , begin : usize , end : usize ) -> ! {
892892 assert ! ( begin <= end) ;
893893 panic ! ( "index {begin} and/or {end} in `{s:?}` do not lie on character boundary" ) ;
894894}
@@ -897,7 +897,7 @@ pub fn slice_error_fail(s: &Wtf8, begin: usize, end: usize) -> ! {
897897///
898898/// Created with the method `.code_points()`.
899899#[ derive( Clone ) ]
900- pub struct Wtf8CodePoints < ' a > {
900+ pub ( crate ) struct Wtf8CodePoints < ' a > {
901901 bytes : slice:: Iter < ' a , u8 > ,
902902}
903903
0 commit comments