55
66use core:: fmt;
77
8- // needed to prevent defmt macros from breaking, since they emit code that does `defmt::blahblah`.
9- #[ cfg( feature = "defmt-03" ) ]
10- use defmt_03 as defmt;
11-
128#[ cfg( feature = "alloc" ) ]
139extern crate alloc;
1410
@@ -18,7 +14,7 @@ mod impls;
1814///
1915/// This is the `embedded-io` equivalent of [`std::io::SeekFrom`].
2016#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
21- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
17+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
2218pub enum SeekFrom {
2319 /// Sets the offset to the provided number of bytes.
2420 Start ( u64 ) ,
@@ -62,7 +58,7 @@ impl From<std::io::SeekFrom> for SeekFrom {
6258///
6359/// - `WouldBlock` is removed, since `embedded-io` traits are always blocking. See the [crate-level documentation](crate) for details.
6460#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
65- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
61+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
6662#[ non_exhaustive]
6763pub enum ErrorKind {
6864 /// Unspecified error kind.
@@ -229,7 +225,7 @@ impl<T: ?Sized + ErrorType> ErrorType for &mut T {
229225
230226/// Error returned by [`Read::read_exact`]
231227#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
232- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
228+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
233229pub enum ReadExactError < E > {
234230 /// An EOF error was encountered before reading the exact amount of requested bytes.
235231 UnexpectedEof ,
@@ -267,7 +263,7 @@ impl<E: fmt::Debug> core::error::Error for ReadExactError<E> {}
267263
268264/// Errors that could be returned by `Write` on `&mut [u8]`.
269265#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
270- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
266+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
271267#[ non_exhaustive]
272268pub enum SliceWriteError {
273269 /// The target slice was full and so could not receive any new data.
@@ -276,7 +272,7 @@ pub enum SliceWriteError {
276272
277273/// Error returned by [`Write::write_fmt`]
278274#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
279- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
275+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
280276pub enum WriteFmtError < E > {
281277 /// An error was encountered while formatting.
282278 FmtError ,
0 commit comments