5
5
6
6
use core:: fmt;
7
7
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;
11
11
12
12
#[ cfg( feature = "alloc" ) ]
13
13
extern crate alloc;
@@ -18,7 +18,7 @@ mod impls;
18
18
///
19
19
/// This is the `embedded-io` equivalent of [`std::io::SeekFrom`].
20
20
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
21
- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
21
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
22
22
pub enum SeekFrom {
23
23
/// Sets the offset to the provided number of bytes.
24
24
Start ( u64 ) ,
@@ -62,7 +62,7 @@ impl From<std::io::SeekFrom> for SeekFrom {
62
62
///
63
63
/// - `WouldBlock` is removed, since `embedded-io` traits are always blocking. See the [crate-level documentation](crate) for details.
64
64
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
65
- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
65
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
66
66
#[ non_exhaustive]
67
67
pub enum ErrorKind {
68
68
/// Unspecified error kind.
@@ -229,7 +229,7 @@ impl<T: ?Sized + ErrorType> ErrorType for &mut T {
229
229
230
230
/// Error returned by [`Read::read_exact`]
231
231
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
232
- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
232
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
233
233
pub enum ReadExactError < E > {
234
234
/// An EOF error was encountered before reading the exact amount of requested bytes.
235
235
UnexpectedEof ,
@@ -267,7 +267,7 @@ impl<E: fmt::Debug> core::error::Error for ReadExactError<E> {}
267
267
268
268
/// Errors that could be returned by `Write` on `&mut [u8]`.
269
269
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
270
- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
270
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
271
271
#[ non_exhaustive]
272
272
pub enum SliceWriteError {
273
273
/// The target slice was full and so could not receive any new data.
@@ -276,7 +276,7 @@ pub enum SliceWriteError {
276
276
277
277
/// Error returned by [`Write::write_fmt`]
278
278
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
279
- #[ cfg_attr( feature = "defmt-03 " , derive( defmt:: Format ) ) ]
279
+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
280
280
pub enum WriteFmtError < E > {
281
281
/// An error was encountered while formatting.
282
282
FmtError ,
0 commit comments