From aec2de6d94d0a5b8cb47989d4e9622fe33da02aa Mon Sep 17 00:00:00 2001 From: Oakchris1955 <80592203+Oakchris1955@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:53:36 +0300 Subject: [PATCH] refactor: remove unused variable + replace code duplicate with unused function call --- src/fs.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/fs.rs b/src/fs.rs index 211e973..acd6023 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -876,7 +876,6 @@ struct FSProperties { total_clusters: u32, /// sector offset of the FAT fat_offset: u32, - reserved_sectors: u32, first_data_sector: u32, } @@ -1002,22 +1001,13 @@ where } }; - let reserved_sectors: u32 = match boot_record { - BootRecord::FAT(boot_record_fat) => boot_record_fat.bpb.reserved_sector_count.into(), - BootRecord::ExFAT(_boot_record_exfat) => todo!("ExFAT is not yet implemented"), - }; - let first_data_sector = match boot_record { - BootRecord::FAT(boot_record_fat) => { - boot_record_fat.bpb.reserved_sector_count as u32 - + (boot_record_fat.bpb.table_count as u32 * boot_record_fat.fat_sector_size()) - + boot_record_fat.root_dir_sectors() as u32 - } + BootRecord::FAT(boot_record_fat) => boot_record_fat.first_data_sector().into(), BootRecord::ExFAT(_boot_record_exfat) => todo!("ExFAT is not yet implemented"), }; let fat_offset = match boot_record { - BootRecord::FAT(boot_record_fat) => boot_record_fat.bpb.reserved_sector_count.into(), + BootRecord::FAT(boot_record_fat) => boot_record_fat.first_fat_sector().into(), BootRecord::ExFAT(_boot_record_exfat) => todo!("ExFAT is not yet implemented"), }; @@ -1031,7 +1021,6 @@ where cluster_size, fat_offset, total_clusters, - reserved_sectors, first_data_sector, };