Skip to content

Commit 22432ab

Browse files
Merge branch 'master' into add-rusttoml
2 parents a4d5cf3 + 930118e commit 22432ab

File tree

21 files changed

+45
-17
lines changed

21 files changed

+45
-17
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ libp2p-mdns = { version = "0.46.0", path = "protocols/mdns" }
8888
libp2p-memory-connection-limits = { version = "0.3.1", path = "misc/memory-connection-limits" }
8989
libp2p-metrics = { version = "0.15.0", path = "misc/metrics" }
9090
libp2p-mplex = { version = "0.42.0", path = "muxers/mplex" }
91-
libp2p-noise = { version = "0.45.0", path = "transports/noise" }
91+
libp2p-noise = { version = "0.45.1", path = "transports/noise" }
9292
libp2p-perf = { version = "0.4.0", path = "protocols/perf" }
9393
libp2p-ping = { version = "0.45.1", path = "protocols/ping" }
9494
libp2p-plaintext = { version = "0.42.0", path = "transports/plaintext" }
@@ -111,7 +111,7 @@ libp2p-webrtc-utils = { version = "0.3.0", path = "misc/webrtc-utils" }
111111
libp2p-webrtc-websys = { version = "0.4.0-alpha.2", path = "transports/webrtc-websys" }
112112
libp2p-websocket = { version = "0.44.1", path = "transports/websocket" }
113113
libp2p-websocket-websys = { version = "0.4.1", path = "transports/websocket-websys" }
114-
libp2p-webtransport-websys = { version = "0.4.0", path = "transports/webtransport-websys" }
114+
libp2p-webtransport-websys = { version = "0.4.1", path = "transports/webtransport-websys" }
115115
libp2p-yamux = { version = "0.46.0", path = "muxers/yamux" }
116116

117117
# External dependencies

protocols/gossipsub/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
- Introduce back pressure and penalize slow peers. Drop stale messages that timeout before being
1919
delivered.
2020
See [PR 5595](https://github.com/libp2p/rust-libp2p/pull/5595).
21+
2122
- Change `Behaviour::unsubscribe` and `Behaviour::report_message_validation_result`
2223
to `bool` they don't need to be a `Result`.
2324
See [PR 5595](https://github.com/libp2p/rust-libp2p/pull/5595).
2425

26+
- Fix `cargo clippy` warnings in `rustc 1.84.0-beta.1`.
27+
See [PR 5700](https://github.com/libp2p/rust-libp2p/pull/5700).
28+
2529
## 0.47.0
2630

2731
<!-- Update to libp2p-swarm v0.45.0 -->

protocols/gossipsub/src/backoff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl BackoffStorage {
131131
pub(crate) fn is_backoff_with_slack(&self, topic: &TopicHash, peer: &PeerId) -> bool {
132132
self.backoffs
133133
.get(topic)
134-
.map_or(false, |m| m.contains_key(peer))
134+
.is_some_and(|m| m.contains_key(peer))
135135
}
136136

137137
pub(crate) fn get_backoff_time(&self, topic: &TopicHash, peer: &PeerId) -> Option<Instant> {

protocols/gossipsub/src/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ where
17161716
let self_published = !self.config.allow_self_origin()
17171717
&& if let Some(own_id) = self.publish_config.get_own_id() {
17181718
own_id != propagation_source
1719-
&& raw_message.source.as_ref().map_or(false, |s| s == own_id)
1719+
&& raw_message.source.as_ref().is_some_and(|s| s == own_id)
17201720
} else {
17211721
self.published_message_ids.contains(msg_id)
17221722
};

protocols/kad/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
See [PR 5573](https://github.com/libp2p/rust-libp2p/pull/5573).
77
- Add `Behavior::find_closest_local_peers()`.
88
See [PR 5645](https://github.com/libp2p/rust-libp2p/pull/5645).
9+
- Fix `cargo clippy` warnings in `rustc 1.84.0-beta.1`.
10+
See [PR 5700](https://github.com/libp2p/rust-libp2p/pull/5700).
911

1012
## 0.46.2
1113

protocols/kad/src/jobs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl PutRecordJob {
208208
T: RecordStore,
209209
{
210210
if self.inner.check_ready(cx, now) {
211-
let publish = self.next_publish.map_or(false, |t_pub| now >= t_pub);
211+
let publish = self.next_publish.is_some_and(|t_pub| now >= t_pub);
212212
let records = store
213213
.records()
214214
.filter_map(|r| {

protocols/kad/src/kbucket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,12 @@ where
531531

532532
/// Returns true if the bucket has a pending node.
533533
pub fn has_pending(&self) -> bool {
534-
self.bucket.pending().map_or(false, |n| !n.is_ready())
534+
self.bucket.pending().is_some_and(|n| !n.is_ready())
535535
}
536536

537537
/// Tests whether the given distance falls into this bucket.
538538
pub fn contains(&self, d: &Distance) -> bool {
539-
BucketIndex::new(d).map_or(false, |i| i == self.index)
539+
BucketIndex::new(d).is_some_and(|i| i == self.index)
540540
}
541541

542542
/// Generates a random distance that falls into this bucket.

protocols/kad/src/kbucket/bucket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ where
382382
// Adjust `first_connected_pos` accordingly.
383383
match status {
384384
NodeStatus::Connected => {
385-
if self.first_connected_pos.map_or(false, |p| p == pos.0)
385+
if self.first_connected_pos.is_some_and(|p| p == pos.0)
386386
&& pos.0 == self.nodes.len()
387387
{
388388
// It was the last connected node.
@@ -403,7 +403,7 @@ where
403403

404404
/// Returns the status of the node at the given position.
405405
pub(crate) fn status(&self, pos: Position) -> NodeStatus {
406-
if self.first_connected_pos.map_or(false, |i| pos.0 >= i) {
406+
if self.first_connected_pos.is_some_and(|i| pos.0 >= i) {
407407
NodeStatus::Connected
408408
} else {
409409
NodeStatus::Disconnected

protocols/kad/src/record.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Record {
104104

105105
/// Checks whether the record is expired w.r.t. the given `Instant`.
106106
pub fn is_expired(&self, now: Instant) -> bool {
107-
self.expires.map_or(false, |t| now >= t)
107+
self.expires.is_some_and(|t| now >= t)
108108
}
109109
}
110110

@@ -158,7 +158,7 @@ impl ProviderRecord {
158158
/// Checks whether the provider record is expired w.r.t. the given
159159
/// `Instant`.
160160
pub fn is_expired(&self, now: Instant) -> bool {
161-
self.expires.map_or(false, |t| now >= t)
161+
self.expires.is_some_and(|t| now >= t)
162162
}
163163
}
164164

0 commit comments

Comments
 (0)