mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-02 22:22:15 +00:00
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`.