@@ -16,7 +16,6 @@ use num_enum::TryFromPrimitive;
16
16
/// SDT (the end of the Creator Revision at offset 36).
17
17
mod offsets {
18
18
use super :: * ;
19
-
20
19
/// 32-bit physical address at which each processor can access its
21
20
/// local APIC.
22
21
pub const LOCAL_INT_CTRL_ADDR : Range < usize > = 0 ..4 ;
@@ -81,8 +80,7 @@ impl IcsType {
81
80
if length == self . expected_len ( ) as usize - 2 {
82
81
Ok ( ( ) )
83
82
} else {
84
- error ! ( "Invalid length={} for type=0x{:x}" ,
85
- * self as u8 , length) ;
83
+ error ! ( "Invalid length={} for type=0x{:x}" , * self as u8 , length) ;
86
84
Err ( Error :: InvalidValue )
87
85
}
88
86
}
@@ -255,16 +253,18 @@ impl Ics {
255
253
apic_proc_uid : NativeEndian :: read_u32 ( & bytes[ 10 ..14 ] ) ,
256
254
} ) ,
257
255
_ => {
258
- error ! ( "type=0x{:x} length={} not implemented" ,
259
- ty as u8 ,
260
- bytes. len( ) ) ;
256
+ error ! (
257
+ "type=0x{:x} length={} not implemented" ,
258
+ ty as u8 ,
259
+ bytes. len( )
260
+ ) ;
261
261
Err ( Error :: NotImplemented )
262
262
}
263
263
}
264
264
}
265
265
266
266
/// Encode into the byte sequence
267
- pub fn encode < T : Array < Item = u8 > > (
267
+ pub fn encode < T : Array < Item = u8 > > (
268
268
& self ,
269
269
buffer : & mut ArrayVec < T > ,
270
270
) -> Result < ( ) > {
@@ -295,8 +295,10 @@ impl Ics {
295
295
NativeEndian :: write_u32 ( & mut tmp_buf[ 8 ..12 ] , gsi_base) ;
296
296
}
297
297
_ => {
298
- error ! ( "The ICS Type {:?} has not been implemented" ,
299
- self . ics_type( ) ) ;
298
+ error ! (
299
+ "The ICS Type {:?} has not been implemented" ,
300
+ self . ics_type( )
301
+ ) ;
300
302
return Err ( Error :: NotImplemented ) ;
301
303
}
302
304
}
@@ -393,22 +395,22 @@ impl<'a> Iterator for IcsIterator<'a> {
393
395
let ty = match IcsType :: try_from ( self . bytes [ 0 ] ) {
394
396
Ok ( ty) => ty,
395
397
_ => {
396
- error ! ( "Invalid ICS type: {}" ,
397
- self . bytes[ 0 ] ) ;
398
+ error ! ( "Invalid ICS type: {}" , self . bytes[ 0 ] ) ;
398
399
return Some ( Err ( Error :: InvalidValue ) ) ;
399
400
}
400
401
} ;
401
402
let len = self . bytes [ 1 ] as usize ;
402
403
403
404
if len > self . bytes . len ( ) {
404
- error ! ( "Payload for type=0x{:x} and len={} to big for buffer len={}" ,
405
- ty as u8 ,
406
- len,
407
- self . bytes. len( ) ) ;
405
+ error ! (
406
+ "Payload for type=0x{:x} and len={} to big for buffer len={}" ,
407
+ ty as u8 ,
408
+ len,
409
+ self . bytes. len( )
410
+ ) ;
408
411
return Some ( Err ( Error :: InvalidValue ) ) ;
409
412
} else if len < 3 {
410
- error ! ( "length `{}` provided is too small" ,
411
- len) ;
413
+ error ! ( "length `{}` provided is too small" , len) ;
412
414
return Some ( Err ( Error :: InvalidValue ) ) ;
413
415
}
414
416
@@ -434,7 +436,7 @@ pub struct MADTBuilder<T: Array> {
434
436
structures : ArrayVec < T > ,
435
437
}
436
438
437
- impl < T : Array < Item = Ics > > MADTBuilder < T > {
439
+ impl < T : Array < Item = Ics > > MADTBuilder < T > {
438
440
/// Create a new builder for the MADT SDT.
439
441
pub fn new ( ) -> MADTBuilder < T > {
440
442
MADTBuilder {
@@ -462,8 +464,8 @@ impl<T: Array<Item=Ics>> MADTBuilder<T> {
462
464
}
463
465
464
466
impl < U > SDTBuilder for MADTBuilder < U >
465
- where
466
- U : Array < Item = Ics > ,
467
+ where
468
+ U : Array < Item = Ics > ,
467
469
{
468
470
const SIGNATURE : [ u8 ; 4 ] = [ b'A' , b'P' , b'I' , b'C' ] ;
469
471
@@ -472,7 +474,7 @@ impl<U> SDTBuilder for MADTBuilder<U>
472
474
5u8
473
475
}
474
476
475
- fn encode_table < T : Array < Item = u8 > > (
477
+ fn encode_table < T : Array < Item = u8 > > (
476
478
& mut self ,
477
479
buffer : & mut ArrayVec < T > ,
478
480
) -> Result < ( ) > {
0 commit comments