@@ -42,7 +42,6 @@ impl RawFile {
4242/// If you drop a value of this type, it closes the file automatically. However,
4343/// it holds a mutable reference to its parent `VolumeManager`, which restricts
4444/// which operations you can perform.
45- #[ cfg_attr( feature = "defmt-log" , derive( defmt:: Format ) ) ]
4645pub struct File < ' a , D , T , const MAX_DIRS : usize , const MAX_FILES : usize , const MAX_VOLUMES : usize >
4746where
4847 D : crate :: BlockDevice ,
@@ -150,6 +149,18 @@ where
150149 }
151150}
152151
152+ #[ cfg( feature = "defmt-log" ) ]
153+ impl < ' a , D , T , const MAX_DIRS : usize , const MAX_FILES : usize , const MAX_VOLUMES : usize >
154+ defmt:: Format for File < ' a , D , T , MAX_DIRS , MAX_FILES , MAX_VOLUMES >
155+ where
156+ D : crate :: BlockDevice ,
157+ T : crate :: TimeSource ,
158+ {
159+ fn format ( & self , fmt : defmt:: Formatter ) {
160+ defmt:: write!( fmt, "File({})" , self . raw_file. 0 . 0 )
161+ }
162+ }
163+
153164/// Errors related to file operations
154165#[ cfg_attr( feature = "defmt-log" , derive( defmt:: Format ) ) ]
155166#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
0 commit comments