SubSlice(Mut): custom Debug implementation
This commit is contained in:
parent
56871201dd
commit
b96805c1c4
1 changed files with 19 additions and 0 deletions
|
|
@ -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<S: SliceLike> 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<S: SliceLike> SubSliceMut<'_, S> {
|
||||
pub fn new(fat_fs: &mut FatFs<S>, offset: u64, len: usize) -> SubSliceMut<'_, S> {
|
||||
SubSliceMut {
|
||||
|
|
@ -70,6 +80,15 @@ pub struct SubSlice<'a, S: SliceLike> {
|
|||
len: usize,
|
||||
}
|
||||
|
||||
impl<S: SliceLike> 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<S: SliceLike> SubSlice<'_, S> {
|
||||
pub fn new(fat_fs: &mut FatFs<S>, offset: u64, len: usize) -> SubSlice<'_, S> {
|
||||
SubSlice {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue