From 520b6978f39fa66c9a16df0d7eba7fd2eb4d58b2 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 168ffb2034cd..420c9bc104df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2528,7 +2528,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 1dce34011c8e..9a2d690e3b18 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 833af07982c9..a514ad992edc 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.41.2 - unreleased + +- 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 7380695023b9..7ead34b69d9f 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 8656b89228c3..22e7a0532fa9 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.