File tree Expand file tree Collapse file tree 3 files changed +25
-15
lines changed
Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -553,10 +553,10 @@ impl OsString {
553553 }
554554
555555 /// 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- }
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+ // }
560560
561561 /// More well behaving alternative to allowing outer types
562562 /// full mutable access to the core `Vec`.
@@ -565,6 +565,11 @@ impl OsString {
565565 pub ( crate ) fn truncate ( & mut self , len : usize ) {
566566 self . inner . truncate ( len) ;
567567 }
568+
569+ #[ inline]
570+ pub ( crate ) fn extend_from_slice ( & mut self , other : & [ u8 ] ) {
571+ self . inner . extend_from_slice ( other) ;
572+ }
568573}
569574
570575#[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -1163,10 +1163,10 @@ pub struct PathBuf {
11631163}
11641164
11651165impl PathBuf {
1166- #[ inline]
1167- fn as_mut_vec ( & mut self ) -> & mut Vec < u8 > {
1168- self . inner . as_mut_vec_for_path_buf ( )
1169- }
1166+ // #[inline]
1167+ // fn as_mut_vec(&mut self) -> &mut Vec<u8> {
1168+ // self.inner.as_mut_vec_for_path_buf()
1169+ // }
11701170
11711171 /// Allocates an empty `PathBuf`.
11721172 ///
@@ -2645,18 +2645,18 @@ impl Path {
26452645 None => {
26462646 // Enough capacity for the extension and the dot
26472647 let capacity = self_len + extension. len ( ) + 1 ;
2648- let whole_path = self_bytes. iter ( ) ;
2648+ let whole_path = self_bytes;
26492649 ( capacity, whole_path)
26502650 }
26512651 Some ( previous_extension) => {
26522652 let capacity = self_len + extension. len ( ) - previous_extension. len ( ) ;
2653- let path_till_dot = self_bytes[ ..self_len - previous_extension. len ( ) ] . iter ( ) ;
2653+ let path_till_dot = & self_bytes[ ..self_len - previous_extension. len ( ) ] ;
26542654 ( capacity, path_till_dot)
26552655 }
26562656 } ;
26572657
26582658 let mut new_path = PathBuf :: with_capacity ( new_capacity) ;
2659- new_path. as_mut_vec ( ) . extend ( slice_to_copy) ;
2659+ new_path. inner . extend_from_slice ( slice_to_copy) ;
26602660 new_path. set_extension ( extension) ;
26612661 new_path
26622662 }
Original file line number Diff line number Diff line change @@ -203,10 +203,10 @@ impl Buf {
203203 }
204204
205205 /// 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- }
206+ // #[inline]
207+ // pub(crate) fn as_mut_vec_for_path_buf(&mut self) -> &mut Vec<u8> {
208+ // &mut self.inner
209+ // }
210210
211211 /// More well behaving alternative to allowing outer types
212212 /// full mutable access to the core `Vec`.
@@ -215,6 +215,11 @@ impl Buf {
215215 pub ( crate ) fn truncate ( & mut self , len : usize ) {
216216 self . inner . truncate ( len) ;
217217 }
218+
219+ #[ inline]
220+ pub ( crate ) fn extend_from_slice ( & mut self , other : & [ u8 ] ) {
221+ self . inner . extend_from_slice ( other) ;
222+ }
218223}
219224
220225impl Slice {
You can’t perform that action at this time.
0 commit comments