File tree 1 file changed +9
-14
lines changed
compiler/rustc_serialize/src
1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -504,19 +504,6 @@ impl<'a> MemDecoder<'a> {
504
504
panic ! ( "MemDecoder exhausted" )
505
505
}
506
506
507
- #[ inline]
508
- fn read_byte ( & mut self ) -> u8 {
509
- if self . current == self . end {
510
- Self :: decoder_exhausted ( ) ;
511
- }
512
- // SAFETY: This type guarantees current <= end, and we just checked current == end.
513
- unsafe {
514
- let byte = * self . current ;
515
- self . current = self . current . add ( 1 ) ;
516
- byte
517
- }
518
- }
519
-
520
507
#[ inline]
521
508
fn read_array < const N : usize > ( & mut self ) -> [ u8 ; N ] {
522
509
self . read_raw_bytes ( N ) . try_into ( ) . unwrap ( )
@@ -586,7 +573,15 @@ impl<'a> Decoder for MemDecoder<'a> {
586
573
587
574
#[ inline]
588
575
fn read_u8 ( & mut self ) -> u8 {
589
- self . read_byte ( )
576
+ if self . current == self . end {
577
+ Self :: decoder_exhausted ( ) ;
578
+ }
579
+ // SAFETY: This type guarantees current <= end, and we just checked current == end.
580
+ unsafe {
581
+ let byte = * self . current ;
582
+ self . current = self . current . add ( 1 ) ;
583
+ byte
584
+ }
590
585
}
591
586
592
587
#[ inline]
You can’t perform that action at this time.
0 commit comments