Skip to content

Commit 18df8ce

Browse files
chore: update dependencies (#318)
* chore: update dependencies * fix warnings * remove bits_decode casting * suppress manual_is_multiple_of * suppress more warnings * review: add todos --------- Co-authored-by: ruben <[email protected]>
1 parent e523eaf commit 18df8ce

File tree

26 files changed

+148
-200
lines changed

26 files changed

+148
-200
lines changed

.github/actions/compliance/action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ runs:
1414
using: "composite"
1515
steps:
1616
- name: Install Rust toolchain
17-
uses: actions-rs/toolchain@v1
17+
uses: actions-rust-lang/setup-rust-toolchain@v1
1818
with:
1919
toolchain: stable
20-
override: true
2120

2221
- name: Cache builds
2322
uses: camshaft/rust-cache@v1
@@ -67,7 +66,7 @@ runs:
6766
# publish report only when pushing to master
6867
- name: Push to gh-pages
6968
if: github.ref == 'refs/heads/master'
70-
uses: ad-m/github-push-action@master
69+
uses: ad-m/github-push-action@v1
7170
with:
7271
github_token: ${{ github.token }}
7372
branch: gh-pages

.github/workflows/CI.yml

Lines changed: 27 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
env:
99
RUST_BACKTRACE: 1
1010
toolchain_style: stable
11-
toolchain_msrv: 1.70.0
11+
toolchain_msrv: 1.74.1
1212
toolchain_h3_quinn_msrv: 1.74.1
1313
toolchain_doc: nightly-2025-04-02
1414
toolchain_lint: stable
@@ -35,76 +35,49 @@ jobs:
3535
name: Check Style
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v5
3939
- name: Install Rust ${{ env.toolchain_style }}
40-
uses: actions-rs/toolchain@v1
40+
uses: actions-rust-lang/setup-rust-toolchain@v1
4141
with:
42-
profile: minimal
4342
toolchain: ${{ env.toolchain_style }}
44-
override: true
4543
components: rustfmt
46-
- uses: Swatinem/rust-cache@v2
47-
- name: cargo fmt --all -- --check
48-
uses: actions-rs/cargo@v1
49-
with:
50-
command: fmt
51-
args: --all -- --check
44+
- run: cargo fmt --all -- --check
5245

5346
lint:
5447
name: Lint
5548
runs-on: ubuntu-latest
5649
steps:
57-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v5
5851
- name: Install Rust ${{ env.toolchain_lint }}
59-
uses: actions-rs/toolchain@v1
52+
uses: actions-rust-lang/setup-rust-toolchain@v1
6053
with:
61-
profile: minimal
6254
toolchain: ${{ env.toolchain_lint }}
63-
override: true
6455
components: clippy
65-
- uses: Swatinem/rust-cache@v2
66-
- name: cargo clippy
67-
uses: actions-rs/cargo@v1
68-
with:
69-
command: clippy
56+
- run: cargo clippy
7057

7158
msrv:
7259
name: Check MSRV
7360
needs: [style]
7461
runs-on: ubuntu-latest
7562
steps:
76-
- uses: actions/checkout@v3
63+
- uses: actions/checkout@v5
7764
- name: Install Rust ${{ env.toolchain_msrv }}
78-
uses: actions-rs/toolchain@v1
65+
uses: actions-rust-lang/setup-rust-toolchain@v1
7966
with:
80-
profile: minimal
8167
toolchain: ${{ env.toolchain_msrv }}
82-
override: true
83-
- uses: Swatinem/rust-cache@v2
84-
- name: cargo check -p h3
85-
uses: actions-rs/cargo@v1
86-
with:
87-
command: check
88-
args: -p h3
68+
- run: cargo check -p h3
8969

9070
msrv_h3_quinn:
9171
name: Check MSRV of `h3-quinn`
9272
needs: [style]
9373
runs-on: ubuntu-latest
9474
steps:
95-
- uses: actions/checkout@v3
75+
- uses: actions/checkout@v5
9676
- name: Install Rust ${{ env.toolchain_h3_quinn_msrv }}
97-
uses: actions-rs/toolchain@v1
77+
uses: actions-rust-lang/setup-rust-toolchain@v1
9878
with:
99-
profile: minimal
10079
toolchain: ${{ env.toolchain_h3_quinn_msrv }}
101-
override: true
102-
- uses: Swatinem/rust-cache@v2
103-
- name: cargo check -p h3-quinn
104-
uses: actions-rs/cargo@v1
105-
with:
106-
command: check
107-
args: -p h3-quinn
80+
- run: cargo check -p h3-quinn
10881

10982
test:
11083
name: Test ${{ matrix.toolchain }} ${{ matrix.os }} ${{ matrix.target }}
@@ -123,7 +96,7 @@ jobs:
12396
target: i686-unknown-linux-gnu
12497
runs-on: ${{ matrix.os }}
12598
steps:
126-
- uses: actions/checkout@v3
99+
- uses: actions/checkout@v5
127100
# Add this step for 32-bit build support
128101
- name: Install 32-bit development libraries
129102
if: matrix.target == 'i686-unknown-linux-gnu'
@@ -132,18 +105,13 @@ jobs:
132105
sudo apt-get update
133106
sudo apt-get install -y gcc-multilib libc6-dev-i386
134107
- name: Install Rust ${{ matrix.toolchain }}
135-
uses: actions-rs/toolchain@v1
108+
uses: actions-rust-lang/setup-rust-toolchain@v1
136109
with:
137-
profile: minimal
138110
toolchain: ${{ matrix.toolchain }}
139111
target: ${{ matrix.target }}
140-
override: true
141-
- uses: Swatinem/rust-cache@v2
142-
- name: cargo test
143-
uses: actions-rs/cargo@v1
144-
with:
145-
command: test
146-
args: --features ${{ matrix.features }} --target ${{ matrix.target }}
112+
- run: cargo test --features ${{ matrix.features }} --target ${{ matrix.target }}
113+
env: #[cfg(feature = "datagram")] unexpected `cfg` condition value: `datagram`
114+
RUSTFLAGS: "-A unexpected_cfgs"
147115
- name: h3Spec
148116
run: ./ci/h3spec.sh
149117
if: matrix.toolchain == 'stable'
@@ -153,49 +121,35 @@ jobs:
153121
needs: [test]
154122
runs-on: ubuntu-latest
155123
steps:
156-
- uses: actions/checkout@v3
124+
- uses: actions/checkout@v5
157125
- name: Install Rust ${{ env.toolchain_doc }}
158-
uses: actions-rs/toolchain@v1
126+
uses: actions-rust-lang/setup-rust-toolchain@v1
159127
with:
160-
profile: minimal
161128
toolchain: ${{ env.toolchain_doc }}
162-
override: true
163-
- uses: Swatinem/rust-cache@v2
164-
- name: cargo rustdoc -p h3 -- -D intra-doc-link-resolution-failure
165-
uses: actions-rs/cargo@v1
166-
with:
167-
command: rustdoc
168-
args: -p h3 -- -D intra-doc-link-resolution-failure
129+
- run: cargo rustdoc -p h3 -- -D intra-doc-link-resolution-failure
169130

170131
fuzz:
171132
name: Fuzz test
172133
needs: [test]
173134
runs-on: ubuntu-latest
174135
steps:
175-
- uses: actions/checkout@v3
136+
- uses: actions/checkout@v5
176137
- name: Install Rust ${{ env.toolchain_fuzz }}
177-
uses: actions-rs/toolchain@v1
138+
uses: actions-rust-lang/setup-rust-toolchain@v1
178139
with:
179-
profile: minimal
180140
toolchain: ${{ env.toolchain_fuzz }}
181-
override: true
182-
- uses: Swatinem/rust-cache@v2
183141
- name: Install cargo-fuzz
184142
uses: camshaft/install@v1
185143
with:
186144
crate: cargo-fuzz
187-
- name: cargo fuzz run fuzz_varint -- -runs=1
188-
uses: actions-rs/cargo@v1
189-
with:
190-
command: fuzz
191-
args: run fuzz_varint -- -runs=1
145+
- run: cargo fuzz run fuzz_varint -- -runs=1
192146

193147
compliance:
194148
name: Compliance report
195149
needs: [test]
196150
runs-on: ubuntu-latest
197151
steps:
198-
- uses: actions/checkout@v3
152+
- uses: actions/checkout@v5
199153
with:
200154
persist-credentials: false
201155
fetch-depth: 0
@@ -209,13 +163,10 @@ jobs:
209163
needs: [test]
210164
runs-on: ubuntu-latest
211165
steps:
212-
- uses: actions/checkout@v3
166+
- uses: actions/checkout@v5
213167
- name: Install Rust stable
214-
uses: actions-rs/toolchain@v1
168+
uses: actions-rust-lang/setup-rust-toolchain@v1
215169
with:
216-
profile: minimal
217170
toolchain: stable
218-
override: true
219-
- uses: Swatinem/rust-cache@v2
220171
- name: Run server and client examples test
221172
run: ./ci/example_test.sh

examples/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ quinn = { version = "0.11", default-features = false, features = [
1919
"rustls",
2020
"ring",
2121
] }
22-
rcgen = { version = "0.13" }
22+
rcgen = { version = "0.14" }
2323
rustls = { version = "0.23", default-features = false, features = [
2424
"logging",
2525
"ring",
2626
"std",
2727
] }
28-
rustls-native-certs = "0.7"
28+
rustls-native-certs = "0.8"
2929
structopt = "0.3"
3030
tokio = { version = "1.27", features = ["full"] }
3131
tracing = "0.1.37"

examples/client.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{path::PathBuf, sync::Arc};
33
use futures::future;
44
use h3::error::{ConnectionError, StreamError};
55
use rustls::pki_types::CertificateDer;
6+
use rustls_native_certs::CertificateResult;
67
use structopt::StructOpt;
78
use tokio::io::AsyncWriteExt;
89
use tracing::{error, info};
@@ -63,18 +64,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
6364

6465
// load CA certificates stored in the system
6566
let mut roots = rustls::RootCertStore::empty();
66-
match rustls_native_certs::load_native_certs() {
67-
Ok(certs) => {
68-
for cert in certs {
69-
if let Err(e) = roots.add(cert) {
70-
error!("failed to parse trust anchor: {}", e);
71-
}
72-
}
67+
let CertificateResult { certs, errors, .. } = rustls_native_certs::load_native_certs();
68+
for cert in certs {
69+
if let Err(e) = roots.add(cert) {
70+
error!("failed to parse trust anchor: {}", e);
7371
}
74-
Err(e) => {
75-
error!("couldn't load any default trust roots: {}", e);
76-
}
77-
};
72+
}
73+
for e in errors {
74+
error!("couldn't load default trust roots: {}", e);
75+
}
7876

7977
// load certificate of CA who issues the server certificate
8078
// NOTE that this should be used for dev only

h3-datagram/src/datagram.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ where
2020
B: Buf,
2121
{
2222
/// Creates a new datagram frame
23+
// TODO: remove for MSRV >= 1.87 https://github.com/rust-lang/rust/issues/128101
24+
#[allow(unknown_lints, clippy::manual_is_multiple_of)]
2325
pub fn new(stream_id: StreamId, payload: B) -> Self {
2426
assert!(
2527
stream_id.into_inner() % 4 == 0,
@@ -106,7 +108,7 @@ where
106108

107109
fn chunk(&self) -> &[u8] {
108110
if self.len - self.pos > 0 {
109-
return &self.stream_id[self.pos..self.len];
111+
&self.stream_id[self.pos..self.len]
110112
} else {
111113
self.payload.chunk()
112114
}

h3-quinn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "h3-quinn"
33
version = "0.0.10"
4-
rust-version = "1.70"
4+
rust-version = "1.74"
55
authors = ["Jean-Christophe BEGUE <[email protected]>"]
66
edition = "2021"
77
documentation = "https://docs.rs/h3-quinn"

h3-quinn/src/datagram.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<B: Buf> SendDatagram<B> for SendDatagramHandler {
3131
let mut buf: EncodedDatagram<B> = data.into();
3232
self.conn
3333
.send_datagram(buf.copy_to_bytes(buf.remaining()))
34-
.map_err(|err| convert_send_datagram_error(err))
34+
.map_err(convert_send_datagram_error)
3535
}
3636
}
3737

@@ -49,7 +49,7 @@ impl RecvDatagram for RecvDatagramHandler {
4949
Poll::Ready(
5050
ready!(self.datagrams.poll_next_unpin(cx))
5151
.expect("self. datagrams never returns None")
52-
.map_err(|e| convert_connection_error(e)),
52+
.map_err(convert_connection_error),
5353
)
5454
}
5555
}
@@ -90,9 +90,7 @@ fn convert_h3_error_to_datagram_error(
9090
) -> h3_datagram::ConnectionErrorIncoming {
9191
match error {
9292
ConnectionErrorIncoming::ApplicationClose { error_code } => {
93-
h3_datagram::ConnectionErrorIncoming::ApplicationClose {
94-
error_code: error_code,
95-
}
93+
h3_datagram::ConnectionErrorIncoming::ApplicationClose { error_code }
9694
}
9795
ConnectionErrorIncoming::Timeout => h3_datagram::ConnectionErrorIncoming::Timeout,
9896
ConnectionErrorIncoming::InternalError(err) => {

h3-quinn/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ where
7979
) -> Poll<Result<Self::BidiStream, ConnectionErrorIncoming>> {
8080
let (send, recv) = ready!(self.incoming_bi.poll_next_unpin(cx))
8181
.expect("self.incoming_bi BoxStream never returns None")
82-
.map_err(|e| convert_connection_error(e))?;
82+
.map_err(convert_connection_error)?;
8383
Poll::Ready(Ok(Self::BidiStream {
8484
send: Self::SendStream::new(send),
8585
recv: Self::RecvStream::new(recv),
@@ -93,7 +93,7 @@ where
9393
) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>> {
9494
let recv = ready!(self.incoming_uni.poll_next_unpin(cx))
9595
.expect("self.incoming_uni BoxStream never returns None")
96-
.map_err(|e| convert_connection_error(e))?;
96+
.map_err(convert_connection_error)?;
9797
Poll::Ready(Ok(Self::RecvStream::new(recv)))
9898
}
9999

@@ -383,7 +383,7 @@ impl quic::RecvStream for RecvStream {
383383
let (stream, chunk) = ready!(self.read_chunk_fut.poll(cx));
384384
self.stream = Some(stream);
385385
Poll::Ready(Ok(chunk
386-
.map_err(|e| convert_read_error_to_stream_error(e))?
386+
.map_err(convert_read_error_to_stream_error)?
387387
.map(|c| c.bytes)))
388388
}
389389

@@ -450,7 +450,7 @@ where
450450
{
451451
fn new(stream: quinn::SendStream) -> SendStream<B> {
452452
Self {
453-
stream: stream,
453+
stream,
454454
writing: None,
455455
}
456456
}
@@ -466,7 +466,7 @@ where
466466
while data.has_remaining() {
467467
let stream = Pin::new(&mut self.stream);
468468
let written = ready!(stream.poll_write(cx, data.chunk()))
469-
.map_err(|err| convert_write_error_to_stream_error(err))?;
469+
.map_err(convert_write_error_to_stream_error)?;
470470
data.advance(written);
471471
}
472472
}

0 commit comments

Comments
 (0)