Skip to content

Commit 7cfc6b4

Browse files
formatting.
1 parent 4efc52a commit 7cfc6b4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mythril/src/vm.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const MAX_IMAGE_MAPPING_PER_VM: usize = 16;
5353
///
5454
/// This method must be called before calling 'virtual_machines'
5555
pub unsafe fn init_virtual_machines(
56-
machines: impl Iterator<Item=VirtualMachine>,
56+
machines: impl Iterator<Item = VirtualMachine>,
5757
) -> Result<()> {
5858
for machine in machines {
5959
VIRTUAL_MACHINE_SET.insert(machine)?;
@@ -114,7 +114,8 @@ impl VirtualMachineSet {
114114
/// Create a new VirtualMachineSet
115115
const fn new() -> Self {
116116
Self {
117-
contexts: ArrayVec::<[VirtualMachineContext; MAX_VCPU_COUNT]>::new(),
117+
contexts: ArrayVec::<[VirtualMachineContext; MAX_VCPU_COUNT]>::new(
118+
),
118119
vms: ArrayVec::<[VirtualMachine; MAX_VM_COUNT]>::new(),
119120
}
120121
}
@@ -278,7 +279,7 @@ impl VirtualMachineSet {
278279
}
279280

280281
/// Receive all pending messages for the current core
281-
pub fn recv_all_msgs(&self) -> impl Iterator<Item=VirtualMachineMsg> {
282+
pub fn recv_all_msgs(&self) -> impl Iterator<Item = VirtualMachineMsg> {
282283
let context = self
283284
.context_by_core_id(percore::read_core_id())
284285
.expect("No VirtualMachineContext for apic id");
@@ -318,7 +319,7 @@ impl StaticVirtualDevices {
318319

319320
fn devices(
320321
&self,
321-
) -> impl Iterator<Item=&RwLock<dyn virtdev::EmulatedDevice>> {
322+
) -> impl Iterator<Item = &RwLock<dyn virtdev::EmulatedDevice>> {
322323
core::array::IntoIter::new([
323324
&self.acpi_runtime as &RwLock<dyn virtdev::EmulatedDevice>,
324325
&self.vga_controller as &RwLock<dyn virtdev::EmulatedDevice>,
@@ -436,7 +437,7 @@ pub struct VirtualMachine {
436437

437438
/// Portions of the per-core Local APIC state needed for logical addressing
438439
pub logical_apic_state:
439-
BTreeMap<percore::CoreId, virtdev::lapic::LogicalApicState>,
440+
BTreeMap<percore::CoreId, virtdev::lapic::LogicalApicState>,
440441

441442
/// The number of vcpus that are up and waiting to start
442443
cpus_ready: AtomicU32,
@@ -574,7 +575,7 @@ impl VirtualMachine {
574575
pub fn logical_apic_destination(
575576
&self,
576577
mask: u32,
577-
) -> Result<impl Iterator<Item=&percore::CoreId>> {
578+
) -> Result<impl Iterator<Item = &percore::CoreId>> {
578579
// FIXME: currently we only support the 'Flat Model' logical mode
579580
// (so we just ignore the destination format register). See 10.6.2.2
580581
// of Volume 3A of the Intel software developer's manual
@@ -736,7 +737,7 @@ mod test {
736737
32,
737738
host_devices,
738739
)
739-
.unwrap();
740+
.unwrap();
740741

741742
VirtualMachine::new(0, config, &info).unwrap();
742743
}

0 commit comments

Comments
 (0)