From 7a31ff843c7bb8c047d6a019fd98a2de81e61fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20RIBEAU?= Date: Mon, 27 Nov 2023 16:57:56 +0100 Subject: [PATCH] feat(core): impl Display on ListenerId --- Cargo.lock | 2 +- Cargo.toml | 2 +- core/CHANGELOG.md | 5 +++++ core/Cargo.toml | 2 +- core/src/transport.rs | 6 ++++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d6031af9cf..c77b3e5e165 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2527,7 +2527,7 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.41.1" +version = "0.41.2" dependencies = [ "async-std", "either", diff --git a/Cargo.toml b/Cargo.toml index 1e243c418eb..4f477e5c91a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,7 +76,7 @@ libp2p = { version = "0.53.0", path = "libp2p" } libp2p-allow-block-list = { version = "0.3.0", path = "misc/allow-block-list" } libp2p-autonat = { version = "0.12.0", path = "protocols/autonat" } libp2p-connection-limits = { version = "0.3.0", path = "misc/connection-limits" } -libp2p-core = { version = "0.41.1", path = "core" } +libp2p-core = { version = "0.41.2", path = "core" } libp2p-dcutr = { version = "0.11.0", path = "protocols/dcutr" } libp2p-dns = { version = "0.41.1", path = "transports/dns" } libp2p-floodsub = { version = "0.44.0", path = "protocols/floodsub" } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 833af07982c..a7cd7fd46b4 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.41.2 + +- Implement `std::fmt::Display` on `ListenerId`. + See [PR 4936](https://github.com/libp2p/rust-libp2p/pull/4936). + ## 0.41.1 - Implement `{In,Out}boundConnectionUpgrade` for `SelectUpgrade`. diff --git a/core/Cargo.toml b/core/Cargo.toml index 7380695023b..7ead34b69d9 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-core" edition = "2021" rust-version = { workspace = true } description = "Core traits and structs of libp2p" -version = "0.41.1" +version = "0.41.2" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/core/src/transport.rs b/core/src/transport.rs index 8656b89228c..22e7a0532fa 100644 --- a/core/src/transport.rs +++ b/core/src/transport.rs @@ -256,6 +256,12 @@ impl ListenerId { } } +impl std::fmt::Display for ListenerId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} + /// Event produced by [`Transport`]s. pub enum TransportEvent { /// A new address is being listened on.