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> {
8686
8787 /// Get the Volume Label string for this volume
8888 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 ] ,
9392 }
9493 }
9594
@@ -98,10 +97,9 @@ impl<'a> Bpb<'a> {
9897 /// On a FAT32 volume, return the free block count from the Info Block. On
9998 /// a FAT16 volume, returns None.
10099 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 ( ) ) ) ) ,
105103 }
106104 }
107105
You can’t perform that action at this time.
0 commit comments