aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Dodd <[email protected]>2021-08-22 00:11:19 +0100
committerRichard Dodd <[email protected]>2021-08-22 00:11:19 +0100
commit7ca745a5c0bf8cdee578ee1108e78b73b7161f4e (patch)
treebc7dc39367566dd32dab09cb2c537eab707c94fd
parent4d3c07f71b9402bf1735b7f81035d90e6de7a28e (diff)
Refactor to allow defmt to intern strings.
-rw-r--r--embassy/src/util/mpsc.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/embassy/src/util/mpsc.rs b/embassy/src/util/mpsc.rs
index 364b98aa4..4257ecd40 100644
--- a/embassy/src/util/mpsc.rs
+++ b/embassy/src/util/mpsc.rs
@@ -441,14 +441,10 @@ impl<T> fmt::Display for TrySendError<T> {
441#[cfg(feature = "defmt")] 441#[cfg(feature = "defmt")]
442impl<T> defmt::Format for TrySendError<T> { 442impl<T> defmt::Format for TrySendError<T> {
443 fn format(&self, fmt: defmt::Formatter<'_>) { 443 fn format(&self, fmt: defmt::Formatter<'_>) {
444 defmt::write!( 444 match self {
445 fmt, 445 TrySendError::Full(..) => defmt::write!(fmt, "no available capacity"),
446 "{}", 446 TrySendError::Closed(..) => defmt::write!(fmt, "channel closed"),
447 match self { 447 }
448 TrySendError::Full(..) => "no available capacity",
449 TrySendError::Closed(..) => "channel closed",
450 }
451 )
452 } 448 }
453} 449}
454 450