Skip to content

Commit 0073309

Browse files
committed
chore: Update MSRV to Rust 1.92
Restore let chains and is_multiple_of() which are stable in 1.92.
1 parent 6fdf3e2 commit 0073309

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ jobs:
4242
- run: cargo test -- --test-threads=1
4343

4444
msrv:
45-
name: MSRV (1.85)
45+
name: MSRV (1.92)
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v4
4949
- uses: dtolnay/rust-toolchain@master
5050
with:
51-
toolchain: "1.85"
51+
toolchain: "1.92"
5252
- uses: Swatinem/rust-cache@v2
5353
- run: cargo build --all-targets
5454

src/ping_manager.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ impl PingManager {
5757
/// Returns `true` and clears pending state if timeout exceeded.
5858
/// Call when the instant from `next_timeout_at()` is reached.
5959
pub fn check_timeout(&mut self) -> bool {
60-
if let Some(sent_at) = self.pending {
61-
if sent_at.elapsed() > self.timeout {
62-
self.pending = None;
63-
return true;
64-
}
60+
if let Some(sent_at) = self.pending
61+
&& sent_at.elapsed() > self.timeout
62+
{
63+
self.pending = None;
64+
return true;
6565
}
6666
false
6767
}

src/ws.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async fn connect_with_retry(
150150
loop {
151151
let selected_url = if attempt == 1 {
152152
primary_url
153-
} else if attempt % 2 == 0 {
153+
} else if attempt.is_multiple_of(2) {
154154
secondary_url
155155
} else {
156156
primary_url

0 commit comments

Comments
 (0)