diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index e9913310aec..9cd4ca30de0 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -7,8 +7,12 @@ - Deprecate `{In,Out}boundUpgradeExt`, as they are not used in rust-libp2p. See [PR 3807]. +- Deprecate `OptionalUpgrade` without replacement. + See [PR 3806]. + [PR 3747]: https://github.com/libp2p/rust-libp2p/pull/3747 [PR 3807]: https://github.com/libp2p/rust-libp2p/pull/3807 +[PR 3806]: https://github.com/libp2p/rust-libp2p/pull/3806 ## 0.39.1 diff --git a/core/src/upgrade.rs b/core/src/upgrade.rs index 0eba81aebc8..4c46418e7a7 100644 --- a/core/src/upgrade.rs +++ b/core/src/upgrade.rs @@ -77,17 +77,17 @@ pub use self::{ apply::{apply, apply_inbound, apply_outbound, InboundUpgradeApply, OutboundUpgradeApply}, denied::DeniedUpgrade, error::UpgradeError, - optional::OptionalUpgrade, pending::PendingUpgrade, ready::ReadyUpgrade, select::SelectUpgrade, transfer::{read_length_prefixed, read_varint, write_length_prefixed, write_varint}, }; pub use crate::Negotiated; -pub use multistream_select::{NegotiatedComplete, NegotiationError, ProtocolError, Version}; - #[allow(deprecated)] pub use map::{MapInboundUpgrade, MapInboundUpgradeErr, MapOutboundUpgrade, MapOutboundUpgradeErr}; +pub use multistream_select::{NegotiatedComplete, NegotiationError, ProtocolError, Version}; +#[allow(deprecated)] +pub use optional::OptionalUpgrade; /// Types serving as protocol names. /// diff --git a/core/src/upgrade/optional.rs b/core/src/upgrade/optional.rs index c661a4f0170..40303db2bdf 100644 --- a/core/src/upgrade/optional.rs +++ b/core/src/upgrade/optional.rs @@ -18,6 +18,8 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#![allow(deprecated)] + use crate::upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo}; /// Upgrade that can be disabled at runtime. @@ -25,6 +27,9 @@ use crate::upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo}; /// Wraps around an `Option` and makes it available or not depending on whether it contains or /// not an upgrade. #[derive(Debug, Clone)] +#[deprecated( + note = "Will be removed without replacement because it is not used within rust-libp2p." +)] pub struct OptionalUpgrade(Option); impl OptionalUpgrade {