@@ -21,7 +21,7 @@ pub struct Buf {
2121}
2222
2323#[ repr( transparent) ]
24- pub struct Slice {
24+ pub struct OsSlice {
2525 pub inner : [ u8 ] ,
2626}
2727
@@ -56,13 +56,13 @@ impl fmt::Display for Buf {
5656 }
5757}
5858
59- impl fmt:: Debug for Slice {
59+ impl fmt:: Debug for OsSlice {
6060 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
6161 fmt:: Debug :: fmt ( & self . inner . utf8_chunks ( ) . debug ( ) , f)
6262 }
6363}
6464
65- impl fmt:: Display for Slice {
65+ impl fmt:: Display for OsSlice {
6666 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
6767 // If we're the empty string then our iterator won't actually yield
6868 // anything, so perform the formatting manually
@@ -135,7 +135,7 @@ impl Buf {
135135 }
136136
137137 #[ inline]
138- pub fn push_slice ( & mut self , s : & Slice ) {
138+ pub fn push_slice ( & mut self , s : & OsSlice ) {
139139 self . inner . extend_from_slice ( & s. inner )
140140 }
141141
@@ -175,44 +175,44 @@ impl Buf {
175175 }
176176
177177 #[ inline]
178- pub fn as_slice ( & self ) -> & Slice {
179- // SAFETY: Slice just wraps [u8],
178+ pub fn as_slice ( & self ) -> & OsSlice {
179+ // SAFETY: OsSlice just wraps [u8],
180180 // and &*self.inner is &[u8], therefore
181- // transmuting &[u8] to &Slice is safe.
181+ // transmuting &[u8] to &OsSlice is safe.
182182 unsafe { mem:: transmute ( self . inner . as_slice ( ) ) }
183183 }
184184
185185 #[ inline]
186- pub fn as_mut_slice ( & mut self ) -> & mut Slice {
187- // SAFETY: Slice just wraps [u8],
186+ pub fn as_mut_slice ( & mut self ) -> & mut OsSlice {
187+ // SAFETY: OsSlice just wraps [u8],
188188 // and &mut *self.inner is &mut [u8], therefore
189- // transmuting &mut [u8] to &mut Slice is safe.
189+ // transmuting &mut [u8] to &mut OsSlice is safe.
190190 unsafe { mem:: transmute ( self . inner . as_mut_slice ( ) ) }
191191 }
192192
193193 #[ inline]
194- pub fn leak < ' a > ( self ) -> & ' a mut Slice {
194+ pub fn leak < ' a > ( self ) -> & ' a mut OsSlice {
195195 unsafe { mem:: transmute ( self . inner . leak ( ) ) }
196196 }
197197
198198 #[ inline]
199- pub fn into_box ( self ) -> Box < Slice > {
199+ pub fn into_box ( self ) -> Box < OsSlice > {
200200 unsafe { mem:: transmute ( self . inner . into_boxed_slice ( ) ) }
201201 }
202202
203203 #[ inline]
204- pub fn from_box ( boxed : Box < Slice > ) -> Buf {
204+ pub fn from_box ( boxed : Box < OsSlice > ) -> Buf {
205205 let inner: Box < [ u8 ] > = unsafe { mem:: transmute ( boxed) } ;
206206 Buf { inner : inner. into_vec ( ) }
207207 }
208208
209209 #[ inline]
210- pub fn into_arc ( & self ) -> Arc < Slice > {
210+ pub fn into_arc ( & self ) -> Arc < OsSlice > {
211211 self . as_slice ( ) . into_arc ( )
212212 }
213213
214214 #[ inline]
215- pub fn into_rc ( & self ) -> Rc < Slice > {
215+ pub fn into_rc ( & self ) -> Rc < OsSlice > {
216216 self . as_slice ( ) . into_rc ( )
217217 }
218218
@@ -222,7 +222,7 @@ impl Buf {
222222 /// # Safety
223223 ///
224224 /// The length must be at an `OsStr` boundary, according to
225- /// `Slice ::check_public_boundary`.
225+ /// `OsSlice ::check_public_boundary`.
226226 #[ inline]
227227 pub unsafe fn truncate_unchecked ( & mut self , len : usize ) {
228228 self . inner . truncate ( len) ;
@@ -240,14 +240,14 @@ impl Buf {
240240 }
241241}
242242
243- impl Slice {
243+ impl OsSlice {
244244 #[ inline]
245245 pub fn as_encoded_bytes ( & self ) -> & [ u8 ] {
246246 & self . inner
247247 }
248248
249249 #[ inline]
250- pub unsafe fn from_encoded_bytes_unchecked ( s : & [ u8 ] ) -> & Slice {
250+ pub unsafe fn from_encoded_bytes_unchecked ( s : & [ u8 ] ) -> & OsSlice {
251251 unsafe { mem:: transmute ( s) }
252252 }
253253
@@ -295,8 +295,8 @@ impl Slice {
295295 }
296296
297297 #[ inline]
298- pub fn from_str ( s : & str ) -> & Slice {
299- unsafe { Slice :: from_encoded_bytes_unchecked ( s. as_bytes ( ) ) }
298+ pub fn from_str ( s : & str ) -> & OsSlice {
299+ unsafe { OsSlice :: from_encoded_bytes_unchecked ( s. as_bytes ( ) ) }
300300 }
301301
302302 #[ inline]
@@ -320,27 +320,27 @@ impl Slice {
320320 }
321321
322322 #[ inline]
323- pub fn into_box ( & self ) -> Box < Slice > {
323+ pub fn into_box ( & self ) -> Box < OsSlice > {
324324 let boxed: Box < [ u8 ] > = self . inner . into ( ) ;
325325 unsafe { mem:: transmute ( boxed) }
326326 }
327327
328328 #[ inline]
329- pub fn empty_box ( ) -> Box < Slice > {
329+ pub fn empty_box ( ) -> Box < OsSlice > {
330330 let boxed: Box < [ u8 ] > = Default :: default ( ) ;
331331 unsafe { mem:: transmute ( boxed) }
332332 }
333333
334334 #[ inline]
335- pub fn into_arc ( & self ) -> Arc < Slice > {
335+ pub fn into_arc ( & self ) -> Arc < OsSlice > {
336336 let arc: Arc < [ u8 ] > = Arc :: from ( & self . inner ) ;
337- unsafe { Arc :: from_raw ( Arc :: into_raw ( arc) as * const Slice ) }
337+ unsafe { Arc :: from_raw ( Arc :: into_raw ( arc) as * const OsSlice ) }
338338 }
339339
340340 #[ inline]
341- pub fn into_rc ( & self ) -> Rc < Slice > {
341+ pub fn into_rc ( & self ) -> Rc < OsSlice > {
342342 let rc: Rc < [ u8 ] > = Rc :: from ( & self . inner ) ;
343- unsafe { Rc :: from_raw ( Rc :: into_raw ( rc) as * const Slice ) }
343+ unsafe { Rc :: from_raw ( Rc :: into_raw ( rc) as * const OsSlice ) }
344344 }
345345
346346 #[ inline]
@@ -375,7 +375,7 @@ impl Slice {
375375}
376376
377377#[ unstable( feature = "clone_to_uninit" , issue = "126799" ) ]
378- unsafe impl CloneToUninit for Slice {
378+ unsafe impl CloneToUninit for OsSlice {
379379 #[ inline]
380380 #[ cfg_attr( debug_assertions, track_caller) ]
381381 unsafe fn clone_to_uninit ( & self , dst : * mut u8 ) {
0 commit comments