Skip to content

Commit

Permalink
Fix build for Rust 1.65
Browse files Browse the repository at this point in the history
Option.as_slice() requires Rust 1.75
  • Loading branch information
rafalh committed Apr 21, 2024
1 parent 2a7c958 commit 5138b8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/boot_sector.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use core::cmp;
use core::slice;
use core::u16;
use core::u8;

Expand Down Expand Up @@ -657,11 +658,10 @@ fn determine_fs_layout<E: IoError>(options: &FormatVolumeOptions, total_sectors:
return Err(Error::InvalidInput);
};

let allowed_fat_types = if options.fat_type.is_some() {
options.fat_type.as_slice()
} else {
&[FatType::Fat32, FatType::Fat16, FatType::Fat12]
};
let allowed_fat_types: &[FatType] = options
.fat_type
.as_ref()
.map_or(&[FatType::Fat32, FatType::Fat16, FatType::Fat12], slice::from_ref);

for &fat_type in allowed_fat_types {
let root_dir_sectors =
Expand Down

0 comments on commit 5138b8a

Please sign in to comment.