@@ -285,12 +285,12 @@ impl BootServices {
285
285
& mut desc_version,
286
286
)
287
287
}
288
- . to_result_with_val ( || MemoryMapMeta {
289
- map_size,
290
- desc_size,
291
- map_key,
292
- desc_version,
293
- } )
288
+ . to_result_with_val ( || MemoryMapMeta {
289
+ map_size,
290
+ desc_size,
291
+ map_key,
292
+ desc_version,
293
+ } )
294
294
}
295
295
296
296
/// Allocates from a memory pool. The pointer will be 8-byte aligned.
@@ -436,10 +436,10 @@ impl BootServices {
436
436
opt_nonnull_to_ptr ( event_group) ,
437
437
& mut event,
438
438
)
439
- . to_result_with_val (
440
- // OK to unwrap: event is non-null for Status::SUCCESS.
441
- || Event :: from_ptr ( event) . unwrap ( ) ,
442
- )
439
+ . to_result_with_val (
440
+ // OK to unwrap: event is non-null for Status::SUCCESS.
441
+ || Event :: from_ptr ( event) . unwrap ( ) ,
442
+ )
443
443
}
444
444
445
445
/// Sets the trigger for `EventType::TIMER` event.
@@ -602,7 +602,7 @@ impl BootServices {
602
602
InterfaceType :: NATIVE_INTERFACE ,
603
603
interface,
604
604
) )
605
- . to_result_with_val ( || Handle :: from_ptr ( handle) . unwrap ( ) )
605
+ . to_result_with_val ( || Handle :: from_ptr ( handle) . unwrap ( ) )
606
606
}
607
607
608
608
/// Reinstalls a protocol interface on a device handle. `old_interface` is replaced with `new_interface`.
@@ -637,7 +637,7 @@ impl BootServices {
637
637
old_interface,
638
638
new_interface,
639
639
)
640
- . to_result ( )
640
+ . to_result ( )
641
641
}
642
642
643
643
/// Removes a protocol interface from a device handle.
@@ -905,10 +905,10 @@ impl BootServices {
905
905
source_size,
906
906
& mut image_handle,
907
907
)
908
- . to_result_with_val (
909
- // OK to unwrap: image handle is non-null for Status::SUCCESS.
910
- || Handle :: from_ptr ( image_handle) . unwrap ( ) ,
911
- )
908
+ . to_result_with_val (
909
+ // OK to unwrap: image handle is non-null for Status::SUCCESS.
910
+ || Handle :: from_ptr ( image_handle) . unwrap ( ) ,
911
+ )
912
912
}
913
913
}
914
914
@@ -1115,7 +1115,7 @@ impl BootServices {
1115
1115
recursive,
1116
1116
)
1117
1117
}
1118
- . to_result_with_err ( |_| ( ) )
1118
+ . to_result_with_err ( |_| ( ) )
1119
1119
}
1120
1120
1121
1121
/// Disconnect one or more drivers from a controller.
@@ -1142,7 +1142,7 @@ impl BootServices {
1142
1142
Handle :: opt_to_ptr ( child) ,
1143
1143
)
1144
1144
}
1145
- . to_result_with_err ( |_| ( ) )
1145
+ . to_result_with_err ( |_| ( ) )
1146
1146
}
1147
1147
1148
1148
/// Open a protocol interface for a handle.
@@ -1201,18 +1201,18 @@ impl BootServices {
1201
1201
Handle :: opt_to_ptr ( params. controller ) ,
1202
1202
attributes as u32 ,
1203
1203
)
1204
- . to_result_with_val ( || {
1205
- let interface = ( !interface. is_null ( ) ) . then ( || {
1206
- let interface = P :: mut_ptr_from_ffi ( interface) as * const UnsafeCell < P > ;
1207
- & * interface
1208
- } ) ;
1209
-
1210
- ScopedProtocol {
1211
- interface,
1212
- open_params : params,
1213
- boot_services : self ,
1214
- }
1215
- } )
1204
+ . to_result_with_val ( || {
1205
+ let interface = ( !interface. is_null ( ) ) . then ( || {
1206
+ let interface = P :: mut_ptr_from_ffi ( interface) as * const UnsafeCell < P > ;
1207
+ & * interface
1208
+ } ) ;
1209
+
1210
+ ScopedProtocol {
1211
+ interface,
1212
+ open_params : params,
1213
+ boot_services : self ,
1214
+ }
1215
+ } )
1216
1216
}
1217
1217
1218
1218
/// Open a protocol interface for a handle in exclusive mode.
@@ -1273,7 +1273,7 @@ impl BootServices {
1273
1273
TEST_PROTOCOL ,
1274
1274
)
1275
1275
}
1276
- . to_result_with_val ( || ( ) )
1276
+ . to_result_with_val ( || ( ) )
1277
1277
}
1278
1278
1279
1279
/// Get the list of protocol interface [`Guids`][Guid] that are installed
@@ -1804,11 +1804,11 @@ impl MemoryMapMeta {
1804
1804
/// ## UEFI pitfalls
1805
1805
/// Note that a MemoryMap can quickly become outdated, as soon as any explicit
1806
1806
/// or hidden allocation happens.
1807
- ///
1807
+ ///
1808
1808
/// As soon as boot services are excited, all previous obtained memory maps must
1809
1809
/// be considered as outdated, except if the [`MemoryMapKey`] equals the one
1810
1810
/// returned by `exit_boot_services()`.
1811
- ///
1811
+ ///
1812
1812
/// **Please note** that when working with memory maps, the `entry_size` is
1813
1813
/// usually larger than `size_of::<MemoryDescriptor` [[0]]. So to be safe,
1814
1814
/// always use `entry_size` as step-size when interfacing with the memory map on
@@ -2462,7 +2462,7 @@ mod tests_mmap_real {
2462
2462
7 , 1048576 , 0 , 1792 , 15 , 0 , 10 , 8388608 , 0 , 8 , 15 , 0 , 7 , 8421376 , 0 , 3 , 15 , 0 , 10 , 8433664 ,
2463
2463
0 , 1 , 15 , 0 , 7 , 8437760 , 0 , 4 , 15 , 0 , 10 , 8454144 , 0 , 240 , 15 , 0 ,
2464
2464
] ;
2465
-
2465
+
2466
2466
#[ test]
2467
2467
fn basic_functionality ( ) {
2468
2468
let mut buf = MMAP_RAW ;
0 commit comments