File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,9 @@ impl<'a> Bpb<'a> {
86
86
87
87
/// Get the Volume Label string for this volume
88
88
pub fn volume_label ( & self ) -> & [ u8 ] {
89
- if self . fat_type != FatType :: Fat32 {
90
- & self . data [ 43 ..=53 ]
91
- } else {
92
- & self . data [ 71 ..=81 ]
89
+ match self . fat_type {
90
+ FatType :: Fat16 => & self . data [ 43 ..=53 ] ,
91
+ FatType :: Fat32 => & self . data [ 71 ..=81 ] ,
93
92
}
94
93
}
95
94
@@ -98,10 +97,9 @@ impl<'a> Bpb<'a> {
98
97
/// On a FAT32 volume, return the free block count from the Info Block. On
99
98
/// a FAT16 volume, returns None.
100
99
pub fn fs_info_block ( & self ) -> Option < BlockCount > {
101
- if self . fat_type != FatType :: Fat32 {
102
- None
103
- } else {
104
- Some ( BlockCount ( u32:: from ( self . fs_info ( ) ) ) )
100
+ match self . fat_type {
101
+ FatType :: Fat16 => None ,
102
+ FatType :: Fat32 => Some ( BlockCount ( u32:: from ( self . fs_info ( ) ) ) ) ,
105
103
}
106
104
}
107
105
You can’t perform that action at this time.
0 commit comments