diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f546cc..716ee32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - rust_version: nightly run_tests: true # Minimal supported rustc version - - rust_version: 1.46.0 + - rust_version: 1.47.0 run_tests: false runs-on: ubuntu-latest continue-on-error: ${{ matrix.rust_version == 'nightly' }} diff --git a/README.md b/README.md index a5a440e..37cb80b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Rust FAT FS [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt) [![crates.io](https://img.shields.io/crates/v/fatfs)](https://crates.io/crates/fatfs) [![Documentation](https://docs.rs/fatfs/badge.svg)](https://docs.rs/fatfs) -[![Minimum rustc version](https://img.shields.io/badge/rustc-1.46+-yellow.svg)](https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.47+-yellow.svg)](https://blog.rust-lang.org/2020/10/08/Rust-1.47.html) A FAT filesystem library implemented in Rust. diff --git a/src/boot_sector.rs b/src/boot_sector.rs index 812222d..29463d6 100644 --- a/src/boot_sector.rs +++ b/src/boot_sector.rs @@ -411,6 +411,7 @@ impl BiosParameterBlock { } } +#[derive(Debug, Clone)] pub(crate) struct BootSector { bootjmp: [u8; 3], oem_name: [u8; 8], diff --git a/src/dir.rs b/src/dir.rs index 311305d..4fab484 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -21,6 +21,7 @@ use crate::time::TimeProvider; const LFN_PADDING: u16 = 0xFFFF; +#[derive(Debug)] pub(crate) enum DirRawStream<'a, IO: ReadWriteSeek, TP, OCC> { File(File<'a, IO, TP, OCC>), Root(DiskSlice, FsIoAdapter<'a, IO, TP, OCC>>), @@ -105,6 +106,7 @@ enum DirEntryOrShortName<'a, IO: ReadWriteSeek, TP, OCC> { /// /// This struct is created by the `open_dir` or `create_dir` methods on `Dir`. /// The root directory is returned by the `root_dir` method on `FileSystem`. +#[derive(Debug)] pub struct Dir<'a, IO: ReadWriteSeek, TP, OCC> { stream: DirRawStream<'a, IO, TP, OCC>, fs: &'a FileSystem, @@ -581,6 +583,7 @@ impl Clone for Dir<'_, /// An iterator over the directory entries. /// /// This struct is created by the `iter` method on `Dir`. +#[derive(Debug)] pub struct DirIter<'a, IO: ReadWriteSeek, TP, OCC> { stream: DirRawStream<'a, IO, TP, OCC>, fs: &'a FileSystem, diff --git a/src/file.rs b/src/file.rs index 2dd0007..f5a31c2 100644 --- a/src/file.rs +++ b/src/file.rs @@ -12,6 +12,7 @@ const MAX_FILE_SIZE: u32 = core::u32::MAX; /// A FAT filesystem file object used for reading and writing data. /// /// This struct is created by the `open_file` or `create_file` methods on `Dir`. +#[derive(Debug)] pub struct File<'a, IO: ReadWriteSeek, TP, OCC> { // Note first_cluster is None if file is empty first_cluster: Option, diff --git a/src/fs.rs b/src/fs.rs index e386450..64f79eb 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -311,6 +311,7 @@ impl FileSystemStats { /// A FAT filesystem object. /// /// `FileSystem` struct is representing a state of a mounted FAT volume. +#[derive(Debug)] pub struct FileSystem { pub(crate) disk: RefCell, pub(crate) options: FsOptions, @@ -690,6 +691,7 @@ impl Drop for FileSystem { } } +#[derive(Debug)] pub(crate) struct FsIoAdapter<'a, IO: ReadWriteSeek, TP, OCC> { fs: &'a FileSystem, } @@ -747,6 +749,7 @@ fn fat_slice>( DiskSlice::from_sectors(fat_first_sector, sectors_per_fat, mirrors, bpb, io) } +#[derive(Debug)] pub(crate) struct DiskSlice { begin: u64, size: u64, diff --git a/src/io.rs b/src/io.rs index 3034b4d..91a3c1b 100644 --- a/src/io.rs +++ b/src/io.rs @@ -178,6 +178,7 @@ impl From for SeekFrom { /// `Read`, `Write`, `Seek` traits from this crate are implemented for this type if /// corresponding types from `std::io` are implemented by the inner instance. #[cfg(feature = "std")] +#[derive(Debug)] pub struct StdIoWrapper { inner: T, } diff --git a/src/lib.rs b/src/lib.rs index 8f857a6..4afd64d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,6 +46,7 @@ #![cfg_attr(not(feature = "std"), no_std)] // Disable warnings to not clutter code with cfg too much #![cfg_attr(not(all(feature = "alloc", feature = "lfn")), allow(dead_code, unused_imports))] +#![deny(missing_debug_implementations)] #![warn(clippy::pedantic)] #![allow(clippy::module_name_repetitions, clippy::cast_possible_truncation)]