File tree 5 files changed +10
-34
lines changed
5 files changed +10
-34
lines changed Original file line number Diff line number Diff line change @@ -551,12 +551,6 @@ impl OsString {
551
551
pub fn leak < ' a > ( self ) -> & ' a mut OsStr {
552
552
OsStr :: from_inner_mut ( self . inner . leak ( ) )
553
553
}
554
-
555
- /// Part of a hack to make PathBuf::push/pop more efficient.
556
- #[ inline]
557
- pub ( crate ) fn as_mut_vec_for_path_buf ( & mut self ) -> & mut Vec < u8 > {
558
- self . inner . as_mut_vec_for_path_buf ( )
559
- }
560
554
}
561
555
562
556
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -655,7 +655,11 @@ impl<'a> Components<'a> {
655
655
/// how much of the prefix is left from the point of view of iteration?
656
656
#[ inline]
657
657
fn prefix_remaining ( & self ) -> usize {
658
- if self . front == State :: Prefix { self . prefix_len ( ) } else { 0 }
658
+ if self . front == State :: Prefix {
659
+ self . prefix_len ( )
660
+ } else {
661
+ 0
662
+ }
659
663
}
660
664
661
665
// Given the iteration so far, how much of the pre-State::Body path is left?
@@ -674,7 +678,11 @@ impl<'a> Components<'a> {
674
678
675
679
#[ inline]
676
680
fn is_sep_byte ( & self , b : u8 ) -> bool {
677
- if self . prefix_verbatim ( ) { is_verbatim_sep ( b) } else { is_sep_byte ( b) }
681
+ if self . prefix_verbatim ( ) {
682
+ is_verbatim_sep ( b)
683
+ } else {
684
+ is_sep_byte ( b)
685
+ }
678
686
}
679
687
680
688
/// Extracts a slice corresponding to the portion of the path remaining for iteration.
@@ -1163,11 +1171,6 @@ pub struct PathBuf {
1163
1171
}
1164
1172
1165
1173
impl PathBuf {
1166
- #[ inline]
1167
- fn as_mut_vec ( & mut self ) -> & mut Vec < u8 > {
1168
- self . inner . as_mut_vec_for_path_buf ( )
1169
- }
1170
-
1171
1174
/// Allocates an empty `PathBuf`.
1172
1175
///
1173
1176
/// # Examples
Original file line number Diff line number Diff line change @@ -201,12 +201,6 @@ impl Buf {
201
201
pub fn into_rc ( & self ) -> Rc < Slice > {
202
202
self . as_slice ( ) . into_rc ( )
203
203
}
204
-
205
- /// Part of a hack to make PathBuf::push/pop more efficient.
206
- #[ inline]
207
- pub ( crate ) fn as_mut_vec_for_path_buf ( & mut self ) -> & mut Vec < u8 > {
208
- & mut self . inner
209
- }
210
204
}
211
205
212
206
impl Slice {
Original file line number Diff line number Diff line change @@ -164,12 +164,6 @@ impl Buf {
164
164
pub fn into_rc ( & self ) -> Rc < Slice > {
165
165
self . as_slice ( ) . into_rc ( )
166
166
}
167
-
168
- /// Part of a hack to make PathBuf::push/pop more efficient.
169
- #[ inline]
170
- pub ( crate ) fn as_mut_vec_for_path_buf ( & mut self ) -> & mut Vec < u8 > {
171
- self . inner . as_mut_vec_for_path_buf ( )
172
- }
173
167
}
174
168
175
169
impl Slice {
Original file line number Diff line number Diff line change @@ -473,15 +473,6 @@ impl Wtf8Buf {
473
473
let bytes: Box < [ u8 ] > = unsafe { mem:: transmute ( boxed) } ;
474
474
Wtf8Buf { bytes : bytes. into_vec ( ) , is_known_utf8 : false }
475
475
}
476
-
477
- /// Part of a hack to make PathBuf::push/pop more efficient.
478
- #[ inline]
479
- pub ( crate ) fn as_mut_vec_for_path_buf ( & mut self ) -> & mut Vec < u8 > {
480
- // FIXME: this function should not even exist, as it implies violating Wtf8Buf invariants
481
- // For now, simply assume that is about to happen.
482
- self . is_known_utf8 = false ;
483
- & mut self . bytes
484
- }
485
476
}
486
477
487
478
/// Creates a new WTF-8 string from an iterator of code points.
You can’t perform that action at this time.
0 commit comments