Skip to content

Commit 2105277

Browse files
committed
Add missing Debug implementations.
1 parent fcd3273 commit 2105277

File tree

8 files changed

+12
-2
lines changed

8 files changed

+12
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- rust_version: nightly
1616
run_tests: true
1717
# Minimal supported rustc version
18-
- rust_version: 1.46.0
18+
- rust_version: 1.47.0
1919
run_tests: false
2020
runs-on: ubuntu-latest
2121
continue-on-error: ${{ matrix.rust_version == 'nightly' }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Rust FAT FS
55
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
66
[![crates.io](https://img.shields.io/crates/v/fatfs)](https://crates.io/crates/fatfs)
77
[![Documentation](https://docs.rs/fatfs/badge.svg)](https://docs.rs/fatfs)
8-
[![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)
8+
[![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)
99

1010
A FAT filesystem library implemented in Rust.
1111

src/boot_sector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ impl BiosParameterBlock {
411411
}
412412
}
413413

414+
#[derive(Debug, Clone)]
414415
pub(crate) struct BootSector {
415416
bootjmp: [u8; 3],
416417
oem_name: [u8; 8],

src/dir.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use crate::time::TimeProvider;
2121

2222
const LFN_PADDING: u16 = 0xFFFF;
2323

24+
#[derive(Debug)]
2425
pub(crate) enum DirRawStream<'a, IO: ReadWriteSeek, TP, OCC> {
2526
File(File<'a, IO, TP, OCC>),
2627
Root(DiskSlice<FsIoAdapter<'a, IO, TP, OCC>, FsIoAdapter<'a, IO, TP, OCC>>),
@@ -105,6 +106,7 @@ enum DirEntryOrShortName<'a, IO: ReadWriteSeek, TP, OCC> {
105106
///
106107
/// This struct is created by the `open_dir` or `create_dir` methods on `Dir`.
107108
/// The root directory is returned by the `root_dir` method on `FileSystem`.
109+
#[derive(Debug)]
108110
pub struct Dir<'a, IO: ReadWriteSeek, TP, OCC> {
109111
stream: DirRawStream<'a, IO, TP, OCC>,
110112
fs: &'a FileSystem<IO, TP, OCC>,
@@ -581,6 +583,7 @@ impl<IO: ReadWriteSeek, TP: TimeProvider, OCC: OemCpConverter> Clone for Dir<'_,
581583
/// An iterator over the directory entries.
582584
///
583585
/// This struct is created by the `iter` method on `Dir`.
586+
#[derive(Debug)]
584587
pub struct DirIter<'a, IO: ReadWriteSeek, TP, OCC> {
585588
stream: DirRawStream<'a, IO, TP, OCC>,
586589
fs: &'a FileSystem<IO, TP, OCC>,

src/file.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const MAX_FILE_SIZE: u32 = core::u32::MAX;
1212
/// A FAT filesystem file object used for reading and writing data.
1313
///
1414
/// This struct is created by the `open_file` or `create_file` methods on `Dir`.
15+
#[derive(Debug)]
1516
pub struct File<'a, IO: ReadWriteSeek, TP, OCC> {
1617
// Note first_cluster is None if file is empty
1718
first_cluster: Option<u32>,

src/fs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ impl FileSystemStats {
311311
/// A FAT filesystem object.
312312
///
313313
/// `FileSystem` struct is representing a state of a mounted FAT volume.
314+
#[derive(Debug)]
314315
pub struct FileSystem<IO: ReadWriteSeek, TP, OCC> {
315316
pub(crate) disk: RefCell<IO>,
316317
pub(crate) options: FsOptions<TP, OCC>,
@@ -690,6 +691,7 @@ impl<IO: ReadWriteSeek, TP, OCC> Drop for FileSystem<IO, TP, OCC> {
690691
}
691692
}
692693

694+
#[derive(Debug)]
693695
pub(crate) struct FsIoAdapter<'a, IO: ReadWriteSeek, TP, OCC> {
694696
fs: &'a FileSystem<IO, TP, OCC>,
695697
}
@@ -747,6 +749,7 @@ fn fat_slice<S: ReadWriteSeek, B: BorrowMut<S>>(
747749
DiskSlice::from_sectors(fat_first_sector, sectors_per_fat, mirrors, bpb, io)
748750
}
749751

752+
#[derive(Debug)]
750753
pub(crate) struct DiskSlice<B, S = B> {
751754
begin: u64,
752755
size: u64,

src/io.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ impl From<std::io::SeekFrom> for SeekFrom {
178178
/// `Read`, `Write`, `Seek` traits from this crate are implemented for this type if
179179
/// corresponding types from `std::io` are implemented by the inner instance.
180180
#[cfg(feature = "std")]
181+
#[derive(Debug)]
181182
pub struct StdIoWrapper<T> {
182183
inner: T,
183184
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#![cfg_attr(not(feature = "std"), no_std)]
4747
// Disable warnings to not clutter code with cfg too much
4848
#![cfg_attr(not(all(feature = "alloc", feature = "lfn")), allow(dead_code, unused_imports))]
49+
#![deny(missing_debug_implementations)]
4950
#![warn(clippy::pedantic)]
5051
#![allow(clippy::module_name_repetitions, clippy::cast_possible_truncation)]
5152

0 commit comments

Comments
 (0)