diff --git a/src/subslice.rs b/src/subslice.rs index 25063e8..4dbb43c 100644 --- a/src/subslice.rs +++ b/src/subslice.rs @@ -1,3 +1,4 @@ +use std::fmt::Debug; use std::io::{Read, Write}; use crate::{FatFs, SliceLike}; @@ -9,6 +10,15 @@ pub struct SubSliceMut<'a, S: SliceLike> { len: usize, } +impl Debug for SubSliceMut<'_, S> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("SubSliceMut") + .field("offset", &self.offset) + .field("len", &self.len) + .finish() + } +} + impl SubSliceMut<'_, S> { pub fn new(fat_fs: &mut FatFs, offset: u64, len: usize) -> SubSliceMut<'_, S> { SubSliceMut { @@ -70,6 +80,15 @@ pub struct SubSlice<'a, S: SliceLike> { len: usize, } +impl Debug for SubSlice<'_, S> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("SubSliceMut") + .field("offset", &self.offset) + .field("len", &self.len) + .finish() + } +} + impl SubSlice<'_, S> { pub fn new(fat_fs: &mut FatFs, offset: u64, len: usize) -> SubSlice<'_, S> { SubSlice {