diff --git a/src/fs.rs b/src/fs.rs index 0ad8c2e..a20a0bb 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -294,7 +294,6 @@ impl FsInfoSector { #[derive(Copy, Clone, Debug)] pub struct FsOptions { pub(crate) update_accessed_date: bool, - pub(crate) update_fs_info: bool, } impl FsOptions { @@ -302,7 +301,6 @@ impl FsOptions { pub fn new() -> Self { FsOptions { update_accessed_date: false, - update_fs_info: true, } } @@ -311,12 +309,6 @@ impl FsOptions { self.update_accessed_date = enabled; self } - - /// If enabled library updates FSInfo sector when unmounting (only if modified). - pub fn update_fs_info(mut self, enabled: bool) -> Self { - self.update_fs_info = enabled; - self - } } /// FAT volume statistics. @@ -569,15 +561,13 @@ impl FileSystem { /// Unmounts the filesystem. /// - /// Updates FSInfo sector if `update_fs_info` mount option is enabled. + /// Updates FSInfo sector if needed. pub fn unmount(self) -> io::Result<()> { self.unmount_internal() } fn unmount_internal(&self) -> io::Result<()> { - if self.options.update_fs_info { - self.flush_fs_info()?; - } + self.flush_fs_info()?; Ok(()) }