From 94dfe7ffd5f3820b8e05776cd987140f5b6b330b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Harabie=C5=84?= Date: Sun, 1 Oct 2017 21:39:11 +0200 Subject: [PATCH] Remove exfat references. exfat is very different from fat12/16/32 and wont be supported. --- src/fs.rs | 8 +++----- src/table.rs | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/fs.rs b/src/fs.rs index 8ba2244..ee83338 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -16,7 +16,7 @@ use table::FatTable; #[derive(Debug, Copy, Clone, PartialEq)] pub enum FatType { - Fat12, Fat16, Fat32, ExFat + Fat12, Fat16, Fat32, } pub trait ReadSeek: Read + Seek {} @@ -114,7 +114,7 @@ impl <'a> FatFileSystem<'a> { pub fn new(mut rdr: &'a mut T) -> io::Result> { let boot = Self::read_boot_record(&mut *rdr)?; if boot.boot_sig != [0x55, 0xAA] { - return Err(Error::new(ErrorKind::Other, "invBox::newalid signature")); + return Err(Error::new(ErrorKind::Other, "invalid signature")); } let total_sectors = if boot.bpb.total_sectors_16 == 0 { boot.bpb.total_sectors_32 } else { boot.bpb.total_sectors_16 as u32 }; @@ -213,10 +213,8 @@ impl <'a> FatFileSystem<'a> { FatType::Fat12 } else if total_clusters < 65525 { FatType::Fat16 - } else if total_clusters < 268435445 { - FatType::Fat32 } else { - FatType::ExFat + FatType::Fat32 } } diff --git a/src/table.rs b/src/table.rs index a8e002f..4d9b06d 100644 --- a/src/table.rs +++ b/src/table.rs @@ -32,7 +32,6 @@ impl FatTable { FatType::Fat12 => FatTable::Fat12(FatTable12::from_read(rdr, size)?), FatType::Fat16 => FatTable::Fat16(FatTable16::from_read(rdr, size)?), FatType::Fat32 => FatTable::Fat32(FatTable32::from_read(rdr, size)?), - _ => panic!("TODO: exfat") }; Ok(table) }