diff options
| author | Tarun Singh <[email protected]> | 2024-07-17 17:05:52 -0400 |
|---|---|---|
| committer | Tarun Singh <[email protected]> | 2024-07-17 17:05:52 -0400 |
| commit | a716a3f006e439bbd9d11ab858d8ee4a93ec48f8 (patch) | |
| tree | 49866d4a7beb26b52c294351432369947a03a12e /embassy-net-driver-channel | |
| parent | e1e99879a63408d17d0c947ca65fbeea827467c9 (diff) | |
Reduced define for 'unreachable!' to a single macro rule
Diffstat (limited to 'embassy-net-driver-channel')
| -rw-r--r-- | embassy-net-driver-channel/src/fmt.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/embassy-net-driver-channel/src/fmt.rs b/embassy-net-driver-channel/src/fmt.rs index 35b929fde..8ca61bc39 100644 --- a/embassy-net-driver-channel/src/fmt.rs +++ b/embassy-net-driver-channel/src/fmt.rs | |||
| @@ -90,19 +90,15 @@ macro_rules! todo { | |||
| 90 | }; | 90 | }; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | #[cfg(not(feature = "defmt"))] | ||
| 94 | #[collapse_debuginfo(yes)] | ||
| 95 | macro_rules! unreachable { | ||
| 96 | ($($x:tt)*) => { | ||
| 97 | ::core::unreachable!($($x)*) | ||
| 98 | }; | ||
| 99 | } | ||
| 100 | |||
| 101 | #[cfg(feature = "defmt")] | ||
| 102 | #[collapse_debuginfo(yes)] | 93 | #[collapse_debuginfo(yes)] |
| 103 | macro_rules! unreachable { | 94 | macro_rules! unreachable { |
| 104 | ($($x:tt)*) => { | 95 | ($($x:tt)*) => { |
| 105 | ::defmt::unreachable!($($x)*) | 96 | { |
| 97 | #[cfg(not(feature = "defmt"))] | ||
| 98 | ::core::unreachable!($($x)*); | ||
| 99 | #[cfg(feature = "defmt")] | ||
| 100 | ::defmt::unreachable!($($x)*); | ||
| 101 | } | ||
| 106 | }; | 102 | }; |
| 107 | } | 103 | } |
| 108 | 104 | ||
