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