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;
8+ // Note that defmt macros depend on this being named "defmt" precisely , since they emit code that does `defmt::blahblah`.
9+ #[ cfg( feature = "defmt" ) ]
10+ use defmt;
1111
1212#[ cfg( feature = "alloc" ) ]
1313extern crate alloc;
@@ -18,7 +18,7 @@ mod impls;
1818///
1919/// This is the `embedded-io` equivalent of [`std::io::SeekFrom`].
2020#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
21- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
21+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
2222pub enum SeekFrom {
2323 /// Sets the offset to the provided number of bytes.
2424 Start ( u64 ) ,
@@ -62,7 +62,7 @@ impl From<std::io::SeekFrom> for SeekFrom {
6262///
6363/// - `WouldBlock` is removed, since `embedded-io` traits are always blocking. See the [crate-level documentation](crate) for details.
6464#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
65- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
65+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
6666#[ non_exhaustive]
6767pub enum ErrorKind {
6868 /// Unspecified error kind.
@@ -229,7 +229,7 @@ impl<T: ?Sized + ErrorType> ErrorType for &mut T {
229229
230230/// Error returned by [`Read::read_exact`]
231231#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
232- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
232+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
233233pub enum ReadExactError < E > {
234234 /// An EOF error was encountered before reading the exact amount of requested bytes.
235235 UnexpectedEof ,
@@ -267,7 +267,7 @@ impl<E: fmt::Debug> core::error::Error for ReadExactError<E> {}
267267
268268/// Errors that could be returned by `Write` on `&mut [u8]`.
269269#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
270- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
270+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
271271#[ non_exhaustive]
272272pub enum SliceWriteError {
273273 /// The target slice was full and so could not receive any new data.
@@ -276,7 +276,7 @@ pub enum SliceWriteError {
276276
277277/// Error returned by [`Write::write_fmt`]
278278#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
279- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
279+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
280280pub enum WriteFmtError < E > {
281281 /// An error was encountered while formatting.
282282 FmtError ,
0 commit comments