diff options
Diffstat (limited to 'embassy-net-adin1110')
| -rw-r--r-- | embassy-net-adin1110/src/fmt.rs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/embassy-net-adin1110/src/fmt.rs b/embassy-net-adin1110/src/fmt.rs index 12737c690..2ac42c557 100644 --- a/embassy-net-adin1110/src/fmt.rs +++ b/embassy-net-adin1110/src/fmt.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | #![allow(unused_macros)] | 2 | #![allow(unused)] |
| 3 | 3 | ||
| 4 | use core::fmt::{Debug, Display, LowerHex}; | 4 | use core::fmt::{Debug, Display, LowerHex}; |
| 5 | 5 | ||
| @@ -83,14 +83,17 @@ macro_rules! todo { | |||
| 83 | }; | 83 | }; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | #[cfg(not(feature = "defmt"))] | ||
| 86 | macro_rules! unreachable { | 87 | macro_rules! unreachable { |
| 87 | ($($x:tt)*) => { | 88 | ($($x:tt)*) => { |
| 88 | { | 89 | ::core::unreachable!($($x)*) |
| 89 | #[cfg(not(feature = "defmt"))] | 90 | }; |
| 90 | ::core::unreachable!($($x)*); | 91 | } |
| 91 | #[cfg(feature = "defmt")] | 92 | |
| 92 | ::defmt::unreachable!($($x)*); | 93 | #[cfg(feature = "defmt")] |
| 93 | } | 94 | macro_rules! unreachable { |
| 95 | ($($x:tt)*) => { | ||
| 96 | ::defmt::unreachable!($($x)*) | ||
| 94 | }; | 97 | }; |
| 95 | } | 98 | } |
| 96 | 99 | ||
| @@ -113,7 +116,7 @@ macro_rules! trace { | |||
| 113 | #[cfg(feature = "defmt")] | 116 | #[cfg(feature = "defmt")] |
| 114 | ::defmt::trace!($s $(, $x)*); | 117 | ::defmt::trace!($s $(, $x)*); |
| 115 | #[cfg(not(any(feature = "log", feature="defmt")))] | 118 | #[cfg(not(any(feature = "log", feature="defmt")))] |
| 116 | let _ignored = ($( & $x ),*); | 119 | let _ = ($( & $x ),*); |
| 117 | } | 120 | } |
| 118 | }; | 121 | }; |
| 119 | } | 122 | } |
| @@ -126,7 +129,7 @@ macro_rules! debug { | |||
| 126 | #[cfg(feature = "defmt")] | 129 | #[cfg(feature = "defmt")] |
| 127 | ::defmt::debug!($s $(, $x)*); | 130 | ::defmt::debug!($s $(, $x)*); |
| 128 | #[cfg(not(any(feature = "log", feature="defmt")))] | 131 | #[cfg(not(any(feature = "log", feature="defmt")))] |
| 129 | let _ignored = ($( & $x ),*); | 132 | let _ = ($( & $x ),*); |
| 130 | } | 133 | } |
| 131 | }; | 134 | }; |
| 132 | } | 135 | } |
| @@ -139,7 +142,7 @@ macro_rules! info { | |||
| 139 | #[cfg(feature = "defmt")] | 142 | #[cfg(feature = "defmt")] |
| 140 | ::defmt::info!($s $(, $x)*); | 143 | ::defmt::info!($s $(, $x)*); |
| 141 | #[cfg(not(any(feature = "log", feature="defmt")))] | 144 | #[cfg(not(any(feature = "log", feature="defmt")))] |
| 142 | let _ignored = ($( & $x ),*); | 145 | let _ = ($( & $x ),*); |
| 143 | } | 146 | } |
| 144 | }; | 147 | }; |
| 145 | } | 148 | } |
| @@ -152,7 +155,7 @@ macro_rules! warn { | |||
| 152 | #[cfg(feature = "defmt")] | 155 | #[cfg(feature = "defmt")] |
| 153 | ::defmt::warn!($s $(, $x)*); | 156 | ::defmt::warn!($s $(, $x)*); |
| 154 | #[cfg(not(any(feature = "log", feature="defmt")))] | 157 | #[cfg(not(any(feature = "log", feature="defmt")))] |
| 155 | let _ignored = ($( & $x ),*); | 158 | let _ = ($( & $x ),*); |
| 156 | } | 159 | } |
| 157 | }; | 160 | }; |
| 158 | } | 161 | } |
| @@ -165,7 +168,7 @@ macro_rules! error { | |||
| 165 | #[cfg(feature = "defmt")] | 168 | #[cfg(feature = "defmt")] |
| 166 | ::defmt::error!($s $(, $x)*); | 169 | ::defmt::error!($s $(, $x)*); |
| 167 | #[cfg(not(any(feature = "log", feature="defmt")))] | 170 | #[cfg(not(any(feature = "log", feature="defmt")))] |
| 168 | let _ignored = ($( & $x ),*); | 171 | let _ = ($( & $x ),*); |
| 169 | } | 172 | } |
| 170 | }; | 173 | }; |
| 171 | } | 174 | } |
| @@ -226,7 +229,7 @@ impl<T, E> Try for Result<T, E> { | |||
| 226 | } | 229 | } |
| 227 | } | 230 | } |
| 228 | 231 | ||
| 229 | pub struct Bytes<'a>(pub &'a [u8]); | 232 | pub(crate) struct Bytes<'a>(pub &'a [u8]); |
| 230 | 233 | ||
| 231 | impl<'a> Debug for Bytes<'a> { | 234 | impl<'a> Debug for Bytes<'a> { |
| 232 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | 235 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
