Refactor to allow defmt to intern strings.

This commit is contained in:
Richard Dodd 2021-08-22 00:11:19 +01:00
parent 4d3c07f71b
commit 7ca745a5c0

View File

@ -441,14 +441,10 @@ impl<T> fmt::Display for TrySendError<T> {
#[cfg(feature = "defmt")]
impl<T> defmt::Format for TrySendError<T> {
fn format(&self, fmt: defmt::Formatter<'_>) {
defmt::write!(
fmt,
"{}",
match self {
TrySendError::Full(..) => "no available capacity",
TrySendError::Closed(..) => "channel closed",
TrySendError::Full(..) => defmt::write!(fmt, "no available capacity"),
TrySendError::Closed(..) => defmt::write!(fmt, "channel closed"),
}
)
}
}