Make FsStatusFlags struct fields non-public and add getters
This way new fields can be added later without losing backward compatibility.
This commit is contained in:
parent
0b5b04aca6
commit
85c48d6aec
14
src/fs.rs
14
src/fs.rs
@ -38,8 +38,18 @@ impl FatType {
|
||||
}
|
||||
|
||||
pub struct FsStatusFlags {
|
||||
pub dirty: bool,
|
||||
pub io_error: bool,
|
||||
pub(crate) dirty: bool,
|
||||
pub(crate) io_error: bool,
|
||||
}
|
||||
|
||||
impl FsStatusFlags {
|
||||
pub fn dirty(&self) -> bool {
|
||||
self.dirty
|
||||
}
|
||||
|
||||
pub fn io_error(&self) -> bool {
|
||||
self.io_error
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ReadSeek: Read + Seek {}
|
||||
|
@ -195,8 +195,8 @@ fn test_volume_metadata_fat32() {
|
||||
|
||||
fn test_status_flags(fs: FileSystem) {
|
||||
let status_flags = fs.read_status_flags().unwrap();
|
||||
assert_eq!(status_flags.dirty, false);
|
||||
assert_eq!(status_flags.io_error, false);
|
||||
assert_eq!(status_flags.dirty(), false);
|
||||
assert_eq!(status_flags.io_error(), false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user