From 7d5e6068681c35c925af4681255ec835a7f306ae Mon Sep 17 00:00:00 2001 From: drHuangMHT Date: Mon, 13 Mar 2023 19:06:40 +0800 Subject: [PATCH 1/4] feat: make mdns::Event clone-able --- protocols/mdns/src/behaviour.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocols/mdns/src/behaviour.rs b/protocols/mdns/src/behaviour.rs index b34a1a73629..f2709e90bdf 100644 --- a/protocols/mdns/src/behaviour.rs +++ b/protocols/mdns/src/behaviour.rs @@ -339,7 +339,7 @@ where } /// Event that can be produced by the `Mdns` behaviour. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Event { /// Discovered nodes through mDNS. Discovered(DiscoveredAddrsIter), @@ -352,6 +352,7 @@ pub enum Event { } /// Iterator that produces the list of addresses that have been discovered. +#[derive(Clone)] pub struct DiscoveredAddrsIter { inner: smallvec::IntoIter<[(PeerId, Multiaddr); 4]>, } @@ -379,6 +380,7 @@ impl fmt::Debug for DiscoveredAddrsIter { } /// Iterator that produces the list of addresses that have expired. +#[derive(Clone)] pub struct ExpiredAddrsIter { inner: smallvec::IntoIter<[(PeerId, Multiaddr); 4]>, } From a72e5e2f1edf92324268b837a63fd5b9f00e5373 Mon Sep 17 00:00:00 2001 From: drHuangMHT Date: Mon, 13 Mar 2023 20:23:28 +0800 Subject: [PATCH 2/4] docs: filling CHANGELOG for PR 3606 Unreleased patch version 0.43.1 bumped. Added entry for PR 3606: Deriving 'Clone' for 'mdns::Event' --- protocols/mdns/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index c2b548e3389..62a361a0608 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.43.1 [unreleased] + +- Deriving `Clone` for `mdns::Event`. See [PR 3606]. + # 0.43.0 - Update to `libp2p-core` `v0.39.0`. From 926c7ca99cd5c2de45d6610da45a41ab418ebe3b Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 14 Mar 2023 03:17:21 +1100 Subject: [PATCH 3/4] Update protocols/mdns/CHANGELOG.md --- protocols/mdns/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index 62a361a0608..c877ca48ccb 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -2,6 +2,7 @@ - Deriving `Clone` for `mdns::Event`. See [PR 3606]. +[PR 3606]: https://github.com/libp2p/rust-libp2p/pull/3606 # 0.43.0 - Update to `libp2p-core` `v0.39.0`. From 49d26c4795a45471fc67af3e6bca6477faf86244 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 14 Mar 2023 03:17:36 +1100 Subject: [PATCH 4/4] Update protocols/mdns/CHANGELOG.md --- protocols/mdns/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index c877ca48ccb..0c3b88c018c 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -1,6 +1,6 @@ # 0.43.1 [unreleased] -- Deriving `Clone` for `mdns::Event`. See [PR 3606]. +- Derive `Clone` for `mdns::Event`. See [PR 3606]. [PR 3606]: https://github.com/libp2p/rust-libp2p/pull/3606 # 0.43.0