Skip to content

Commit ce8c280

Browse files
Merge pull request #983 from jmriesen/main
Adding Format impl for core::num::Wrapping
2 parents 60239d2 + be33faf commit ce8c280

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ We have several packages which live in this repository. Changes are tracked sepa
6565
* [#955] Allow using the `defmt/alloc` feature on bare metal ESP32-S2
6666
* [#972] Fix logic bug in env_filter
6767
* [#1007] `defmt`: impl `Format` for `core::fmt::Error`
68+
* [#983] Add `Format` implementation for core::num::Wrapping<T>
6869

6970
### [defmt-v1.0.1] (2025-04-01)
7071

@@ -971,6 +972,7 @@ Initial release
971972
[#1006]: https://github.com/knurling-rs/defmt/pull/1006
972973
[#990]: https://github.com/knurling-rs/defmt/pull/990
973974
[#986]: https://github.com/knurling-rs/defmt/pull/986
975+
[#983]: https://github.com/knurling-rs/defmt/pull/983
974976
[#974]: https://github.com/knurling-rs/defmt/pull/974
975977
[#972]: https://github.com/knurling-rs/defmt/pull/972
976978
[#966]: https://github.com/knurling-rs/defmt/pull/966

defmt/src/impls/core_/num.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::num;
1+
use core::num::{self, Wrapping};
22

33
use super::*;
44

@@ -30,3 +30,9 @@ impl Format for num::TryFromIntError {
3030
crate::write!(fmt, "TryFromIntError(())");
3131
}
3232
}
33+
34+
impl<T: Format> Format for Wrapping<T> {
35+
fn format(&self, fmt: Formatter) {
36+
self.0.format(fmt);
37+
}
38+
}

0 commit comments

Comments
 (0)