Skip to content

Commit fb374fa

Browse files
committed
Silence unssued paramenter in panic message
1 parent 479dbae commit fb374fa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/dma.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ pub trait Channel: private::Channel {
333333
1 => BITS8,
334334
2 => BITS16,
335335
4 => BITS32,
336-
s => crate::panic!("unsupported word size: {:?}", s),
336+
#[cfg(not(feature = "defmt"))]
337+
s => core::panic!("unsupported word size: {:?}", s),
338+
#[cfg(feature = "defmt")]
339+
_ => defmt::panic!("unsupported word size"),
337340
};
338341

339342
self.ch().cr.modify(|_, w| {

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ pub mod watchdog;
161161

162162
cfg_if! {
163163
if #[cfg(feature = "defmt")] {
164+
#[allow(unused_imports)]
164165
pub(crate) use defmt::{assert, panic, unreachable, unwrap};
166+
#[allow(unused_imports)]
165167
pub(crate) use macros::expect;
166168

167169
mod macros {
@@ -177,7 +179,9 @@ cfg_if! {
177179
pub(crate) use expect_wrapper as expect;
178180
}
179181
} else {
182+
#[allow(unused_imports)]
180183
pub(crate) use core::{assert, panic, unreachable};
184+
#[allow(unused_imports)]
181185
pub(crate) use macros::{unwrap, expect};
182186

183187
mod macros {

0 commit comments

Comments
 (0)