Skip to content

Commit 4ee0e07

Browse files
authored
chore: remove unreachable_patterns lint according to note
Remove some `#[allow(unreachable_patterns)]` with #5650 merged. Pull-Request: #5933.
1 parent 924321a commit 4ee0e07

File tree

29 files changed

+1
-116
lines changed

29 files changed

+1
-116
lines changed

misc/allow-block-list/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ where
277277
_: ConnectionId,
278278
event: THandlerOutEvent<Self>,
279279
) {
280-
// TODO: remove when Rust 1.82 is MSRV
281-
#[allow(unreachable_patterns)]
282280
libp2p_core::util::unreachable(event)
283281
}
284282

misc/connection-limits/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ impl NetworkBehaviour for Behaviour {
390390
_: ConnectionId,
391391
event: THandlerOutEvent<Self>,
392392
) {
393-
// TODO: remove when Rust 1.82 is MSRV
394-
#[allow(unreachable_patterns)]
395393
libp2p_core::util::unreachable(event)
396394
}
397395

@@ -722,8 +720,6 @@ mod tests {
722720
_connection_id: ConnectionId,
723721
event: THandlerOutEvent<Self>,
724722
) {
725-
// TODO: remove when Rust 1.82 is MSRV
726-
#[allow(unreachable_patterns)]
727723
libp2p_core::util::unreachable(event)
728724
}
729725

misc/memory-connection-limits/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ impl NetworkBehaviour for Behaviour {
196196
_: ConnectionId,
197197
event: THandlerOutEvent<Self>,
198198
) {
199-
// TODO: remove when Rust 1.82 is MSRV
200-
#[allow(unreachable_patterns)]
201199
libp2p_core::util::unreachable(event)
202200
}
203201

misc/memory-connection-limits/tests/util/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ impl<const MEM_PENDING: usize, const MEM_ESTABLISHED: usize> NetworkBehaviour
118118
_: ConnectionId,
119119
event: THandlerOutEvent<Self>,
120120
) {
121-
// TODO: remove when Rust 1.82 is MSRV
122-
#[allow(unreachable_patterns)]
123121
libp2p_core::util::unreachable(event)
124122
}
125123

protocols/autonat/src/v2/client/handler/dial_back.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ impl ConnectionHandler for Handler {
7676
tracing::warn!("Dial back request dropped, too many requests in flight");
7777
}
7878
}
79-
// TODO: remove when Rust 1.82 is MSRV
80-
#[allow(unreachable_patterns)]
8179
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { error, .. }) => {
8280
libp2p_core::util::unreachable(error);
8381
}

protocols/autonat/src/v2/client/handler/dial_request.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ async fn start_stream_handle(
210210
.map_err(|e| match e {
211211
StreamUpgradeError::NegotiationFailed => Error::UnsupportedProtocol,
212212
StreamUpgradeError::Timeout => Error::Io(io::ErrorKind::TimedOut.into()),
213-
// TODO: remove when Rust 1.82 is MSRV
214-
#[allow(unreachable_patterns)]
215213
StreamUpgradeError::Apply(v) => libp2p_core::util::unreachable(v),
216214
StreamUpgradeError::Io(e) => Error::Io(e),
217215
})?;

protocols/autonat/src/v2/server/behaviour.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ where
111111
Either::Left(Either::Left(Err(e))) => {
112112
tracing::debug!("dial back error: {e:?}");
113113
}
114-
// TODO: remove when Rust 1.82 is MSRV
115-
#[allow(unreachable_patterns)]
116114
Either::Left(Either::Right(v)) => libp2p_core::util::unreachable(v),
117115
Either::Right(Either::Left(cmd)) => {
118116
let addr = cmd.addr.clone();

protocols/autonat/src/v2/server/handler/dial_request.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ where
137137
);
138138
}
139139
}
140-
// TODO: remove when Rust 1.82 is MSRV
141-
#[allow(unreachable_patterns)]
142140
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { error, .. }) => {
143141
tracing::debug!("inbound request failed: {:?}", error);
144142
}

protocols/dcutr/src/behaviour.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ impl NetworkBehaviour for Behaviour {
319319
.or_default() += 1;
320320
self.queued_events.push_back(ToSwarm::Dial { opts });
321321
}
322-
// TODO: remove when Rust 1.82 is MSRV
323-
#[allow(unreachable_patterns)]
324322
Either::Right(never) => libp2p_core::util::unreachable(never),
325323
};
326324
}

protocols/dcutr/src/handler/relayed.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ impl Handler {
117117
self.attempts += 1;
118118
}
119119
// A connection listener denies all incoming substreams, thus none can ever be fully
120-
// negotiated. TODO: remove when Rust 1.82 is MSRV
121-
#[allow(unreachable_patterns)]
120+
// negotiated.
122121
future::Either::Right(output) => libp2p_core::util::unreachable(output),
123122
}
124123
}
@@ -154,8 +153,6 @@ impl Handler {
154153
<Self as ConnectionHandler>::InboundProtocol,
155154
>,
156155
) {
157-
// TODO: remove when Rust 1.82 is MSRV
158-
#[allow(unreachable_patterns)]
159156
libp2p_core::util::unreachable(error.into_inner());
160157
}
161158

@@ -167,8 +164,6 @@ impl Handler {
167164
>,
168165
) {
169166
let error = match error {
170-
// TODO: remove when Rust 1.82 is MSRV
171-
#[allow(unreachable_patterns)]
172167
StreamUpgradeError::Apply(v) => libp2p_core::util::unreachable(v),
173168
StreamUpgradeError::NegotiationFailed => outbound::Error::Unsupported,
174169
StreamUpgradeError::Io(e) => outbound::Error::Io(e),
@@ -296,8 +291,6 @@ impl ConnectionHandler for Handler {
296291
ConnectionEvent::FullyNegotiatedOutbound(fully_negotiated_outbound) => {
297292
self.on_fully_negotiated_outbound(fully_negotiated_outbound)
298293
}
299-
// TODO: remove when Rust 1.82 is MSRV
300-
#[allow(unreachable_patterns)]
301294
ConnectionEvent::ListenUpgradeError(listen_upgrade_error) => {
302295
self.on_listen_upgrade_error(listen_upgrade_error)
303296
}

0 commit comments

Comments
 (0)