Skip to content

Commit

Permalink
remove deprecated builder functions
Browse files Browse the repository at this point in the history
  • Loading branch information
drHuangMHT committed Dec 27, 2024
1 parent 69cf073 commit 5da8aff
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 65 deletions.
22 changes: 0 additions & 22 deletions libp2p/src/builder/phase/bandwidth_logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,6 @@ pub struct BandwidthLoggingPhase<T, R> {
impl<T: AuthenticatedMultiplexedTransport, Provider, R>
SwarmBuilder<Provider, BandwidthLoggingPhase<T, R>>
{
#[allow(deprecated)]
#[deprecated(note = "Use `with_bandwidth_metrics` instead.")]
pub fn with_bandwidth_logging(
self,
) -> (
SwarmBuilder<Provider, BandwidthMetricsPhase<impl AuthenticatedMultiplexedTransport, R>>,
Arc<BandwidthSinks>,
) {
let (transport, sinks) = self.phase.transport.with_bandwidth_logging();
(
SwarmBuilder {
phase: BandwidthMetricsPhase {
relay_behaviour: self.phase.relay_behaviour,
transport,
},
keypair: self.keypair,
phantom: PhantomData,
},
sinks,
)
}

pub fn without_bandwidth_logging(self) -> SwarmBuilder<Provider, BandwidthMetricsPhase<T, R>> {
SwarmBuilder {
phase: BandwidthMetricsPhase {
Expand Down
23 changes: 1 addition & 22 deletions libp2p/src/builder/phase/other_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,7 @@ impl<T: AuthenticatedMultiplexedTransport, Provider>
.with_relay_client(security_upgrade, multiplexer_upgrade)
}
}
impl<Provider, T: AuthenticatedMultiplexedTransport>
SwarmBuilder<Provider, OtherTransportPhase<T>>
{
#[allow(deprecated)]
#[deprecated(note = "Use `with_bandwidth_metrics` instead.")]
pub fn with_bandwidth_logging(
self,
) -> (
SwarmBuilder<
Provider,
BandwidthMetricsPhase<impl AuthenticatedMultiplexedTransport, NoRelayBehaviour>,
>,
Arc<BandwidthSinks>,
) {
#[allow(deprecated)]
self.without_any_other_transports()
.without_dns()
.without_websocket()
.without_relay()
.with_bandwidth_logging()
}
}

#[cfg(feature = "metrics")]
impl<Provider, T: AuthenticatedMultiplexedTransport>
SwarmBuilder<Provider, OtherTransportPhase<T>>
Expand Down
21 changes: 0 additions & 21 deletions libp2p/src/builder/phase/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,27 +276,6 @@ impl_quic_phase_with_websocket!(
super::provider::Tokio,
rw_stream_sink::RwStreamSink<libp2p_websocket::BytesConnection<libp2p_tcp::tokio::TcpStream>>
);
impl<Provider, T: AuthenticatedMultiplexedTransport> SwarmBuilder<Provider, QuicPhase<T>> {
#[allow(deprecated)]
#[deprecated(note = "Use `with_bandwidth_metrics` instead.")]
pub fn with_bandwidth_logging(
self,
) -> (
SwarmBuilder<
Provider,
BandwidthMetricsPhase<impl AuthenticatedMultiplexedTransport, NoRelayBehaviour>,
>,
Arc<crate::bandwidth::BandwidthSinks>,
) {
#[allow(deprecated)]
self.without_quic()
.without_any_other_transports()
.without_dns()
.without_websocket()
.without_relay()
.with_bandwidth_logging()
}
}
#[cfg(feature = "metrics")]
impl<Provider, T: AuthenticatedMultiplexedTransport> SwarmBuilder<Provider, QuicPhase<T>> {
pub fn with_bandwidth_metrics(
Expand Down

0 comments on commit 5da8aff

Please sign in to comment.