Skip to content

Commit

Permalink
refactor: remove unused variable + replace code duplicate with unused…
Browse files Browse the repository at this point in the history
… function call
  • Loading branch information
Oakchris1955 committed Aug 7, 2024
1 parent 12f2eb7 commit aec2de6
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,6 @@ struct FSProperties {
total_clusters: u32,
/// sector offset of the FAT
fat_offset: u32,
reserved_sectors: u32,
first_data_sector: u32,
}

Expand Down Expand Up @@ -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"),
};

Expand All @@ -1031,7 +1021,6 @@ where
cluster_size,
fat_offset,
total_clusters,
reserved_sectors,
first_data_sector,
};

Expand Down

0 comments on commit aec2de6

Please sign in to comment.