Skip to content

Commit 7f5747a

Browse files
committed
Support defmt version 0.3 with new MSRV
1 parent 8e6fc7f commit 7f5747a

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# Failure is permitted on nightly.
2222
rust:
2323
- stable
24-
- 1.53.0
24+
- 1.56.0
2525
- nightly
2626

2727
features:
@@ -68,13 +68,13 @@ jobs:
6868
# Failure is permitted on nightly.
6969
rust:
7070
- stable
71-
- 1.53.0
71+
- 1.56.0
7272
- nightly
7373

7474
features:
7575
# These feature sets cannot run tests, so we only check they build.
7676
- rand-custom-impl medium-ip medium-ethernet medium-ieee802154 proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp async
77-
- rand-custom-impl defmt defmt-trace medium-ip medium-ethernet proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp async
77+
- rand-custom-impl defmt medium-ip medium-ethernet proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp async
7878

7979
steps:
8080
- uses: actions/checkout@v2

Cargo.toml

+1-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ byteorder = { version = "1.0", default-features = false }
2121
log = { version = "0.4.4", default-features = false, optional = true }
2222
libc = { version = "0.2.18", optional = true }
2323
bitflags = { version = "1.0", default-features = false }
24-
defmt = { version = "0.2.0", optional = true }
24+
defmt = { version = "0.3", optional = true }
2525
rand_core = { version = "0.6.3", optional = true, default-features = false }
2626

2727
[dev-dependencies]
@@ -57,12 +57,6 @@ rand-custom-impl = []
5757

5858
"async" = []
5959

60-
defmt-trace = []
61-
defmt-debug = []
62-
defmt-info = []
63-
defmt-warn = []
64-
defmt-error = []
65-
6660
default = [
6761
"std", "log", # needed for `cargo test --no-default-features --features default` :/
6862
"medium-ethernet", "medium-ip", "medium-ieee802154",

src/wire/ieee802154.rs

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ impl fmt::Display for AddressingMode {
6767

6868
/// A IEEE 802.15.4 PAN.
6969
#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
70+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7071
pub struct Pan(pub u16);
7172

7273
impl Pan {
@@ -82,6 +83,7 @@ impl Pan {
8283

8384
/// A IEEE 802.15.4 address.
8485
#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
86+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8587
pub enum Address {
8688
Absent,
8789
Short([u8; 2]),
@@ -745,6 +747,7 @@ impl<T: AsRef<[u8]>> fmt::Display for Frame<T> {
745747

746748
/// A high-level representation of an IEEE802.15.4 frame.
747749
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
750+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
748751
pub struct Repr {
749752
pub frame_type: FrameType,
750753
pub security_enabled: bool,

0 commit comments

Comments
 (0)