Skip to content

Commit cd754b7

Browse files
committed
Support defmt version range (0.2 and 0.3)
1 parent 8a77f32 commit cd754b7

File tree

3 files changed

+11
-40
lines changed

3 files changed

+11
-40
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.7.8] - 2021-11-11
11+
12+
### Added
13+
14+
- A span of `defmt` versions is now supported (`0.2` and `0.3`)
15+
1016
## [v0.7.7] - 2021-09-22
1117

1218
### Fixed
@@ -417,7 +423,8 @@ architecture.
417423

418424
- Initial release
419425

420-
[Unreleased]: https://github.com/japaric/heapless/compare/v0.7.7...HEAD
426+
[Unreleased]: https://github.com/japaric/heapless/compare/v0.7.8...HEAD
427+
[v0.7.9]: https://github.com/japaric/heapless/compare/v0.7.7...v0.7.8
421428
[v0.7.7]: https://github.com/japaric/heapless/compare/v0.7.6...v0.7.7
422429
[v0.7.6]: https://github.com/japaric/heapless/compare/v0.7.5...v0.7.6
423430
[v0.7.5]: https://github.com/japaric/heapless/compare/v0.7.4...v0.7.5

Cargo.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["static", "no-heap"]
1212
license = "MIT OR Apache-2.0"
1313
name = "heapless"
1414
repository = "https://github.com/japaric/heapless"
15-
version = "0.7.7"
15+
version = "0.7.8"
1616

1717
[features]
1818
default = ["cas"]
@@ -24,6 +24,7 @@ x86-sync-pool = []
2424
__trybuild = []
2525
# Enable larger MPMC sizes.
2626
mpmc_large = []
27+
# This flag has no version guarantee, the `defmt` dependency can be updated in a patch release
2728
defmt-impl = ["defmt"]
2829

2930
[target.'cfg(any(target_arch = "x86_64", target_arch = "x86"))'.dev-dependencies]
@@ -55,9 +56,5 @@ optional = true
5556
version = "0.1"
5657

5758
[dependencies.defmt]
58-
version = "0.2.1"
59+
version = ">=0.2.0,<0.4"
5960
optional = true
60-
61-
[dev-dependencies.defmt]
62-
version = "0.2.1"
63-
features = ["unstable-test"]

src/defmt.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,3 @@ where
2121
defmt::write!(fmt, "{=str}", self.as_str());
2222
}
2323
}
24-
25-
#[cfg(test)]
26-
mod tests {
27-
use crate::Vec;
28-
use defmt::Format;
29-
30-
#[test]
31-
/// Tests encoding Vec with defmt, asserting these types may be serialized
32-
/// Note: the exact wire format is NOT checked since its an unstable implementation detail of an external crate.
33-
/// based on https://github.com/knurling-rs/defmt/blob/697a8e807bd766a80ada2d57514a9da1232dbc9a/tests/encode.rs#L523
34-
fn test_defmt_format_vec() {
35-
let val: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
36-
37-
let mut f = defmt::InternalFormatter::new();
38-
let g = defmt::Formatter { inner: &mut f };
39-
val.format(g);
40-
f.finalize();
41-
}
42-
43-
/// Tests encoding String with defmt, asserting these types may be serialized
44-
/// Note: the exact wire format is NOT checked since its an unstable implementation detail of an external crate.
45-
/// based loosely on https://github.com/knurling-rs/defmt/blob/main/tests/encode.rs#L483
46-
#[test]
47-
fn test_defmt_format_str() {
48-
let mut val: crate::String<32> = crate::String::new();
49-
val.push_str("foo").unwrap();
50-
51-
let mut f = defmt::InternalFormatter::new();
52-
let g = defmt::Formatter { inner: &mut f };
53-
val.format(g);
54-
f.finalize();
55-
}
56-
}

0 commit comments

Comments
 (0)