Skip to content

Commit f974fc1

Browse files
authored
Merge pull request #604 from phycrax/impl-defmt-format-capacityerr
Implement defmt::Format for CapacityError
2 parents 6279f8a + 381269b commit f974fc1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
- Minor fixes to module docs.
1111
- Make MSRV of 1.87.0 explicit.
1212

13-
- Implement `Default` for `CapacityError`
13+
- Implement `Default` for `CapacityError`.
14+
- Implement `defmt::Format` for `CapacityError`.
1415

1516
## [v0.9.1] - 2025-08-19
1617

src/defmt.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::{
44
len_type::LenType,
55
string::{StringInner, StringStorage},
66
vec::{VecInner, VecStorage},
7+
CapacityError,
78
};
89
use defmt::Formatter;
910

@@ -21,3 +22,9 @@ impl<LenT: LenType, S: StringStorage + ?Sized> defmt::Format for StringInner<Len
2122
defmt::write!(fmt, "{=str}", self.as_str());
2223
}
2324
}
25+
26+
impl defmt::Format for CapacityError {
27+
fn format(&self, fmt: Formatter<'_>) {
28+
defmt::write!(fmt, "CapacityError");
29+
}
30+
}

0 commit comments

Comments
 (0)