Skip to content

Commit 2d81b99

Browse files
chore(core): remove deprecated upgrades
Related #3647. Pull-Request: #3867.
1 parent 62a06f9 commit 2d81b99

File tree

6 files changed

+4
-617
lines changed

6 files changed

+4
-617
lines changed

core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
- Raise MSRV to 1.65.
44
See [PR 3715].
55

6+
- Remove deprecated symbols related to upgrades.
7+
See [PR 3867].
8+
69
[PR 3715]: https://github.com/libp2p/rust-libp2p/pull/3715
10+
[PR 3867]: https://github.com/libp2p/rust-libp2p/pull/3867
711

812
## 0.39.2
913

core/src/upgrade.rs

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,13 @@ mod apply;
6161
mod denied;
6262
mod either;
6363
mod error;
64-
mod from_fn;
65-
mod map;
66-
mod optional;
6764
mod pending;
6865
mod ready;
6966
mod select;
7067
mod transfer;
7168

7269
use futures::future::Future;
7370

74-
#[allow(deprecated)]
75-
pub use self::from_fn::{from_fn, FromFnUpgrade};
7671
pub use self::{
7772
apply::{apply, apply_inbound, apply_outbound, InboundUpgradeApply, OutboundUpgradeApply},
7873
denied::DeniedUpgrade,
@@ -83,11 +78,7 @@ pub use self::{
8378
transfer::{read_length_prefixed, read_varint, write_length_prefixed, write_varint},
8479
};
8580
pub use crate::Negotiated;
86-
#[allow(deprecated)]
87-
pub use map::{MapInboundUpgrade, MapInboundUpgradeErr, MapOutboundUpgrade, MapOutboundUpgradeErr};
8881
pub use multistream_select::{NegotiatedComplete, NegotiationError, ProtocolError, Version};
89-
#[allow(deprecated)]
90-
pub use optional::OptionalUpgrade;
9182

9283
/// Types serving as protocol names.
9384
///
@@ -164,35 +155,6 @@ pub trait InboundUpgrade<C>: UpgradeInfo {
164155
fn upgrade_inbound(self, socket: C, info: Self::Info) -> Self::Future;
165156
}
166157

167-
/// Extension trait for `InboundUpgrade`. Automatically implemented on all types that implement
168-
/// `InboundUpgrade`.
169-
#[deprecated(
170-
note = "Will be removed without replacement because it is not used within rust-libp2p."
171-
)]
172-
#[allow(deprecated)]
173-
pub trait InboundUpgradeExt<C>: InboundUpgrade<C> {
174-
/// Returns a new object that wraps around `Self` and applies a closure to the `Output`.
175-
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>
176-
where
177-
Self: Sized,
178-
F: FnOnce(Self::Output) -> T,
179-
{
180-
MapInboundUpgrade::new(self, f)
181-
}
182-
183-
/// Returns a new object that wraps around `Self` and applies a closure to the `Error`.
184-
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>
185-
where
186-
Self: Sized,
187-
F: FnOnce(Self::Error) -> T,
188-
{
189-
MapInboundUpgradeErr::new(self, f)
190-
}
191-
}
192-
193-
#[allow(deprecated)]
194-
impl<C, U: InboundUpgrade<C>> InboundUpgradeExt<C> for U {}
195-
196158
/// Possible upgrade on an outbound connection or substream.
197159
pub trait OutboundUpgrade<C>: UpgradeInfo {
198160
/// Output after the upgrade has been successfully negotiated and the handshake performed.
@@ -208,32 +170,3 @@ pub trait OutboundUpgrade<C>: UpgradeInfo {
208170
/// The `info` is the identifier of the protocol, as produced by `protocol_info`.
209171
fn upgrade_outbound(self, socket: C, info: Self::Info) -> Self::Future;
210172
}
211-
212-
/// Extention trait for `OutboundUpgrade`. Automatically implemented on all types that implement
213-
/// `OutboundUpgrade`.
214-
#[deprecated(
215-
note = "Will be removed without replacement because it is not used within rust-libp2p."
216-
)]
217-
#[allow(deprecated)]
218-
pub trait OutboundUpgradeExt<C>: OutboundUpgrade<C> {
219-
/// Returns a new object that wraps around `Self` and applies a closure to the `Output`.
220-
fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>
221-
where
222-
Self: Sized,
223-
F: FnOnce(Self::Output) -> T,
224-
{
225-
MapOutboundUpgrade::new(self, f)
226-
}
227-
228-
/// Returns a new object that wraps around `Self` and applies a closure to the `Error`.
229-
fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>
230-
where
231-
Self: Sized,
232-
F: FnOnce(Self::Error) -> T,
233-
{
234-
MapOutboundUpgradeErr::new(self, f)
235-
}
236-
}
237-
238-
#[allow(deprecated)]
239-
impl<C, U: OutboundUpgrade<C>> OutboundUpgradeExt<C> for U {}

core/src/upgrade/from_fn.rs

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)