@@ -163,63 +163,63 @@ pub(crate) struct EscapeIterInner<const N: usize> {
163
163
}
164
164
165
165
impl < const N : usize > EscapeIterInner < N > {
166
- pub const fn backslash ( c : ascii:: Char ) -> Self {
166
+ pub ( crate ) const fn backslash ( c : ascii:: Char ) -> Self {
167
167
let ( data, range) = backslash ( c) ;
168
168
Self { data, alive : range }
169
169
}
170
170
171
- pub const fn ascii ( c : u8 ) -> Self {
171
+ pub ( crate ) const fn ascii ( c : u8 ) -> Self {
172
172
let ( data, range) = escape_ascii ( c) ;
173
173
Self { data, alive : range }
174
174
}
175
175
176
- pub const fn unicode ( c : char ) -> Self {
176
+ pub ( crate ) const fn unicode ( c : char ) -> Self {
177
177
let ( data, range) = escape_unicode ( c) ;
178
178
Self { data, alive : range }
179
179
}
180
180
181
181
#[ inline]
182
- pub const fn empty ( ) -> Self {
182
+ pub ( crate ) const fn empty ( ) -> Self {
183
183
Self { data : [ ascii:: Char :: Null ; N ] , alive : 0 ..0 }
184
184
}
185
185
186
186
#[ inline]
187
- pub fn as_ascii ( & self ) -> & [ ascii:: Char ] {
187
+ pub ( crate ) fn as_ascii ( & self ) -> & [ ascii:: Char ] {
188
188
// SAFETY: `self.alive` is guaranteed to be a valid range for indexing `self.data`.
189
189
unsafe {
190
190
self . data . get_unchecked ( usize:: from ( self . alive . start ) ..usize:: from ( self . alive . end ) )
191
191
}
192
192
}
193
193
194
194
#[ inline]
195
- pub fn as_str ( & self ) -> & str {
195
+ pub ( crate ) fn as_str ( & self ) -> & str {
196
196
self . as_ascii ( ) . as_str ( )
197
197
}
198
198
199
199
#[ inline]
200
- pub fn len ( & self ) -> usize {
200
+ pub ( crate ) fn len ( & self ) -> usize {
201
201
usize:: from ( self . alive . end - self . alive . start )
202
202
}
203
203
204
- pub fn next ( & mut self ) -> Option < u8 > {
204
+ pub ( crate ) fn next ( & mut self ) -> Option < u8 > {
205
205
let i = self . alive . next ( ) ?;
206
206
207
207
// SAFETY: `i` is guaranteed to be a valid index for `self.data`.
208
208
unsafe { Some ( self . data . get_unchecked ( usize:: from ( i) ) . to_u8 ( ) ) }
209
209
}
210
210
211
- pub fn next_back ( & mut self ) -> Option < u8 > {
211
+ pub ( crate ) fn next_back ( & mut self ) -> Option < u8 > {
212
212
let i = self . alive . next_back ( ) ?;
213
213
214
214
// SAFETY: `i` is guaranteed to be a valid index for `self.data`.
215
215
unsafe { Some ( self . data . get_unchecked ( usize:: from ( i) ) . to_u8 ( ) ) }
216
216
}
217
217
218
- pub fn advance_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
218
+ pub ( crate ) fn advance_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
219
219
self . alive . advance_by ( n)
220
220
}
221
221
222
- pub fn advance_back_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
222
+ pub ( crate ) fn advance_back_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
223
223
self . alive . advance_back_by ( n)
224
224
}
225
225
}
0 commit comments