@@ -42,7 +42,7 @@ const UTF8_REPLACEMENT_CHARACTER: &str = "\u{FFFD}";
42
42
/// which represents a Unicode scalar value:
43
43
/// a code point that is not a surrogate (U+D800 to U+DFFF).
44
44
#[ derive( Eq , PartialEq , Ord , PartialOrd , Clone , Copy ) ]
45
- pub struct CodePoint {
45
+ pub ( crate ) struct CodePoint {
46
46
value : u32 ,
47
47
}
48
48
@@ -133,7 +133,7 @@ impl CodePoint {
133
133
/// Similar to `String`, but can additionally contain surrogate code points
134
134
/// if they’re not in a surrogate pair.
135
135
#[ derive( Eq , PartialEq , Ord , PartialOrd , Clone ) ]
136
- pub struct Wtf8Buf {
136
+ pub ( crate ) struct Wtf8Buf {
137
137
bytes : Vec < u8 > ,
138
138
139
139
/// Do we know that `bytes` holds a valid UTF-8 encoding? We can easily
@@ -496,7 +496,7 @@ impl Extend<CodePoint> for Wtf8Buf {
496
496
/// Similar to `&str`, but can additionally contain surrogate code points
497
497
/// if they’re not in a surrogate pair.
498
498
#[ derive( Eq , Ord , PartialEq , PartialOrd ) ]
499
- pub struct Wtf8 {
499
+ pub ( crate ) struct Wtf8 {
500
500
bytes : [ u8 ] ,
501
501
}
502
502
@@ -869,7 +869,7 @@ fn decode_surrogate_pair(lead: u16, trail: u16) -> char {
869
869
870
870
/// Copied from core::str::StrPrelude::is_char_boundary
871
871
#[ 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 {
873
873
if index == slice. len ( ) {
874
874
return true ;
875
875
}
@@ -881,14 +881,14 @@ pub fn is_code_point_boundary(slice: &Wtf8, index: usize) -> bool {
881
881
882
882
/// Copied from core::str::raw::slice_unchecked
883
883
#[ 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 {
885
885
// memory layout of a &[u8] and &Wtf8 are the same
886
886
Wtf8 :: from_bytes_unchecked ( slice:: from_raw_parts ( s. bytes . as_ptr ( ) . add ( begin) , end - begin) )
887
887
}
888
888
889
889
/// Copied from core::str::raw::slice_error_fail
890
890
#[ 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 ) -> ! {
892
892
assert ! ( begin <= end) ;
893
893
panic ! ( "index {begin} and/or {end} in `{s:?}` do not lie on character boundary" ) ;
894
894
}
@@ -897,7 +897,7 @@ pub fn slice_error_fail(s: &Wtf8, begin: usize, end: usize) -> ! {
897
897
///
898
898
/// Created with the method `.code_points()`.
899
899
#[ derive( Clone ) ]
900
- pub struct Wtf8CodePoints < ' a > {
900
+ pub ( crate ) struct Wtf8CodePoints < ' a > {
901
901
bytes : slice:: Iter < ' a , u8 > ,
902
902
}
903
903
0 commit comments