diff --git a/src/lib.rs b/src/lib.rs index ea620d2c..84dbdbaf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -151,14 +151,8 @@ impl DiskImageBuilder { let stage_3 = FileDataSource::Data(BIOS_STAGE_3.to_vec()); let stage_4 = FileDataSource::Data(BIOS_STAGE_4.to_vec()); let mut internal_files = BTreeMap::new(); - internal_files.insert( - BIOS_STAGE_3_NAME, - stage_3, - ); - internal_files.insert( - BIOS_STAGE_4_NAME, - stage_4, - ); + internal_files.insert(BIOS_STAGE_3_NAME, stage_3); + internal_files.insert(BIOS_STAGE_4_NAME, stage_4); let fat_partition = self .create_fat_filesystem_image(internal_files) .context("failed to create FAT partition")?; @@ -192,10 +186,7 @@ impl DiskImageBuilder { } let mut internal_files = BTreeMap::new(); - internal_files.insert( - UEFI_BOOT_FILENAME, - get_uefi_bootloader(), - ); + internal_files.insert(UEFI_BOOT_FILENAME, get_uefi_bootloader()); let fat_partition = self .create_fat_filesystem_image(internal_files) .context("failed to create FAT partition")?; @@ -240,7 +231,6 @@ impl DiskImageBuilder { let to = tftp_path.join(UEFI_TFTP_BOOT_FILENAME); write_uefi_bootloader(&to)?; - for f in &self.files { let to = tftp_path.join(f.0.deref()); diff --git a/src/mbr.rs b/src/mbr.rs index 36922224..4298a602 100644 --- a/src/mbr.rs +++ b/src/mbr.rs @@ -15,17 +15,19 @@ pub fn create_mbr_disk( boot_partition_path: &Path, out_mbr_path: &Path, ) -> anyhow::Result<()> { - let second_stage = File::open(second_stage_path).context("failed to open second stage binary")?; + let second_stage = + File::open(second_stage_path).context("failed to open second stage binary")?; create_mbr_disk_with_readers( File::open(bootsector_path).context("failed to open boot sector")?, SecondStageData { - size: second_stage.metadata() - .context("failed to read file metadata of second stage")? - .len(), - reader: second_stage + size: second_stage + .metadata() + .context("failed to read file metadata of second stage")? + .len(), + reader: second_stage, }, boot_partition_path, - out_mbr_path + out_mbr_path, ) } @@ -44,7 +46,7 @@ pub fn create_mbr_disk( reader: Cursor::new(second_stage_binary), }, boot_partition_path, - out_mbr_path + out_mbr_path, ) }