Skip to content

Commit

Permalink
fix: address clippy 1.76 (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Feb 8, 2024
1 parent 03f97ad commit f3290b4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.63.0"
msrv = "1.71.0"
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ jobs:
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: 1.70.0
toolchain: stable
profile: minimal
override: true
components: clippy,rustfmt
Expand All @@ -817,11 +817,11 @@ jobs:

- name: Run clippy
working-directory: tools/xdp
run: cargo clippy
run: cargo +stable clippy

- name: Build ebpf
working-directory: tools/xdp
env:
RUST_LOG: trace
run: cargo xtask ci
run: cargo +stable xtask ci

2 changes: 1 addition & 1 deletion .github/workflows/qns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ jobs:

- name: Run cargo build
working-directory: tools/${{ matrix.attack }}-attack
run: cargo build --release
run: cargo +stable build --release

- name: Start client
working-directory: tools/${{ matrix.attack }}-attack
Expand Down
1 change: 0 additions & 1 deletion quic/s2n-quic-core/src/packet/number/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ fn new(value: VarInt) -> PacketNumber {

/// This implementation tries to closely follow the RFC pseudo code so it's
/// easier to ensure it matches.
#[allow(clippy::blocks_in_if_conditions)]
fn rfc_decoder(largest_pn: u64, truncated_pn: u64, pn_nbits: usize) -> u64 {
macro_rules! catch {
($expr:expr) => {
Expand Down
12 changes: 8 additions & 4 deletions quic/s2n-quic-transport/src/connection/connection_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,11 +842,13 @@ impl<C: connection::Trait, L: connection::Lock<C>> ConnectionContainer<C, L> {
let cursor = self.connection_map.find(&connection_id);
let node = cursor.get()?;

let (result, interests) = match node.inner.write(|conn| {
let on_write = |conn: &mut C| {
let result = func(conn);
let interests = conn.interests();
(result, interests)
}) {
};

let (result, interests) = match node.inner.write(on_write) {
Ok(result) => result,
Err(_) => {
// the connection panicked so remove it from the container
Expand Down Expand Up @@ -992,7 +994,7 @@ impl<C: connection::Trait, L: connection::Lock<C>> ConnectionContainer<C, L> {
// also clear the timer to make the state consistent
connection.timeout.set(None);

let mut interests = match connection.inner.write(|conn| {
let on_write = |conn: &mut C| {
let remote_address = conn
.remote_address()
.expect("Remote address should be available");
Expand All @@ -1004,7 +1006,9 @@ impl<C: connection::Trait, L: connection::Lock<C>> ConnectionContainer<C, L> {
);
func(conn, &context);
conn.interests()
}) {
};

let mut interests = match connection.inner.write(on_write) {
Ok(result) => result,
Err(_) => {
self.remove_poisoned_node(&connection);
Expand Down

0 comments on commit f3290b4

Please sign in to comment.