@@ -466,13 +466,13 @@ impl InterruptDescriptorTable {
466
466
/// Panics if the entry is an exception.
467
467
fn condition_slice_bounds ( & self , bounds : impl RangeBounds < u8 > ) -> ( usize , usize ) {
468
468
let lower_idx = match bounds. start_bound ( ) {
469
- Included ( start) => ( * start as usize ) ,
470
- Excluded ( start) => ( * start as usize ) + 1 ,
469
+ Included ( start) => usize :: from ( * start) ,
470
+ Excluded ( start) => usize :: from ( * start) + 1 ,
471
471
Unbounded => 0 ,
472
472
} ;
473
473
let upper_idx = match bounds. end_bound ( ) {
474
- Included ( end) => ( * end as usize ) + 1 ,
475
- Excluded ( end) => ( * end as usize ) ,
474
+ Included ( end) => usize :: from ( * end) + 1 ,
475
+ Excluded ( end) => usize :: from ( * end) ,
476
476
Unbounded => 256 ,
477
477
} ;
478
478
@@ -522,7 +522,7 @@ impl Index<u8> for InterruptDescriptorTable {
522
522
16 => & self . x87_floating_point ,
523
523
19 => & self . simd_floating_point ,
524
524
20 => & self . virtualization ,
525
- i @ 32 ..=255 => & self . interrupts [ ( i - 32 ) as usize ] ,
525
+ i @ 32 ..=255 => & self . interrupts [ usize :: from ( i - 32 ) ] ,
526
526
i @ 15 | i @ 31 | i @ 21 ..=29 => panic ! ( "entry {} is reserved" , i) ,
527
527
i @ 8 | i @ 10 ..=14 | i @ 17 | i @ 30 => {
528
528
panic ! ( "entry {} is an exception with error code" , i)
@@ -551,7 +551,7 @@ impl IndexMut<u8> for InterruptDescriptorTable {
551
551
16 => & mut self . x87_floating_point ,
552
552
19 => & mut self . simd_floating_point ,
553
553
20 => & mut self . virtualization ,
554
- i @ 32 ..=255 => & mut self . interrupts [ ( i - 32 ) as usize ] ,
554
+ i @ 32 ..=255 => & mut self . interrupts [ usize :: from ( i - 32 ) ] ,
555
555
i @ 15 | i @ 31 | i @ 21 ..=29 => panic ! ( "entry {} is reserved" , i) ,
556
556
i @ 8 | i @ 10 ..=14 | i @ 17 | i @ 30 => {
557
557
panic ! ( "entry {} is an exception with error code" , i)
0 commit comments