From bffe4153bcc5718cf8a71beef4d1309bec8f3790 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 13 Dec 2022 15:14:57 +1100 Subject: [PATCH] fix(dcutr): rename error types to bypass `cargo-semver-checks` hickup (#3213) `cargo semver-checks` is still missing features in regards to properly detecting renamed exports. To make our CI pass again, we remove the renamed export, replace it with type-aliases and deprecate them to point users types exported under a module which now follows the conventions set in #2217. --- protocols/dcutr/CHANGELOG.md | 5 +++++ protocols/dcutr/src/lib.rs | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/protocols/dcutr/CHANGELOG.md b/protocols/dcutr/CHANGELOG.md index fad08780..6c45f4cc 100644 --- a/protocols/dcutr/CHANGELOG.md +++ b/protocols/dcutr/CHANGELOG.md @@ -2,6 +2,11 @@ - Update to `libp2p-swarm` `v0.42.0`. +- Declare `InboundUpgradeError` and `OutboundUpgradeError` as type aliases instead of renames. + This is a workaround for a missing feature in `cargo semver-checks`. See [PR 3213]. + +[PR 3213]: https://github.com/libp2p/rust-libp2p/pull/3213 + # 0.8.0 - Update to `prost-codec` `v0.3.0`. diff --git a/protocols/dcutr/src/lib.rs b/protocols/dcutr/src/lib.rs index 738af530..525b2a08 100644 --- a/protocols/dcutr/src/lib.rs +++ b/protocols/dcutr/src/lib.rs @@ -26,13 +26,11 @@ pub mod behaviour; mod handler; mod protocol; - -pub use protocol::{ - inbound::UpgradeError as InboundUpgradeError, outbound::UpgradeError as OutboundUpgradeError, - PROTOCOL_NAME, -}; - #[allow(clippy::derive_partial_eq_without_eq)] mod message_proto { include!(concat!(env!("OUT_DIR"), "/holepunch.pb.rs")); } + +pub use protocol::PROTOCOL_NAME; +pub type InboundUpgradeError = protocol::inbound::UpgradeError; +pub type OutboundUpgradeError = protocol::outbound::UpgradeError;