Skip to content

Commit 886b148

Browse files
authored
{core,swarm}/: Don't require Transport: Clone and take &mut (libp2p#2529)
Previously `libp2p-swarm` required a `Transport` to be `Clone`. Methods on `Transport`, e.g. `Transport::dial` would take ownership, requiring e.g. a `Clone::clone` before calling `Transport::dial`. The requirement of `Transport` to be `Clone` is no longer needed in `libp2p-swarm`. E.g. concurrent dialing can be done without a clone per dial. This commit removes the requirement of `Clone` for `Transport` in `libp2p-swarm`. As a follow-up methods on `Transport` no longer take ownership, but instead a mutable reference (`&mut self`). On the one hand this simplifies `libp2p-swarm`, on the other it simplifies implementations of `Transport`.
1 parent c8af6d8 commit 886b148

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.4.0 [unreleased]
2+
3+
- Update to `libp2p-core` `v0.33.0`.
4+
5+
- Update to `libp2p-swarm` `v0.36.0`.
6+
7+
- Update to `libp2p-request-response` `v0.18.0`.
8+
19
# 0.3.0
210

311
- Update to `libp2p-swarm` `v0.35.0`.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-autonat"
33
edition = "2021"
44
rust-version = "1.56.1"
55
description = "NAT and firewall detection for libp2p"
6-
version = "0.3.0"
6+
version = "0.4.0"
77
authors = ["David Craven <[email protected]>", "Elena Frank <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"
@@ -18,9 +18,9 @@ async-trait = "0.1"
1818
futures = "0.3"
1919
futures-timer = "3.0"
2020
instant = "0.1"
21-
libp2p-core = { version = "0.32.0", path = "../../core", default-features = false }
22-
libp2p-swarm = { version = "0.35.0", path = "../../swarm" }
23-
libp2p-request-response = { version = "0.17.0", path = "../request-response" }
21+
libp2p-core = { version = "0.33.0", path = "../../core", default-features = false }
22+
libp2p-swarm = { version = "0.36.0", path = "../../swarm" }
23+
libp2p-request-response = { version = "0.18.0", path = "../request-response" }
2424
log = "0.4"
2525
rand = "0.8"
2626
prost = "0.10"

0 commit comments

Comments
 (0)