Skip to content

Commit

Permalink
fix(s2n-quic-transport): fix clippy beta warnings (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Jul 12, 2022
1 parent 34179ef commit f9f49dd
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 22 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
include:
- toolchain: stable
# fail on stable warnings
args: "-D warnings"
- toolchain: beta
# deriving Eq may break API compatibility so we disable it
# See https://github.com/rust-lang/rust-clippy/issues/9063
args: "-A derive_partial_eq_without_eq"
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -86,7 +93,7 @@ jobs:
uses: actions-rs/cargo@v1.0.3
with:
command: clippy
args: --all-features --all-targets -- -D warnings
args: --all-features --all-targets -- ${{ matrix.args }}

udeps:
runs-on: ubuntu-latest
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/netbench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
include:
- toolchain: stable
# fail on stable warnings
args: "-D warnings"
- toolchain: beta
# deriving Eq may break API compatibility so we disable it
# See https://github.com/rust-lang/rust-clippy/issues/9063
args: "-A derive_partial_eq_without_eq"
steps:
- uses: actions/checkout@v3

Expand All @@ -65,7 +72,7 @@ jobs:
uses: actions-rs/cargo@v1.0.3
with:
command: clippy
args: --manifest-path netbench/Cargo.toml --all-features --all-targets -- -D warnings
args: --manifest-path netbench/Cargo.toml --all-features --all-targets -- ${{ matrix.args }}

test:
runs-on: ubuntu-latest
Expand Down
8 changes: 1 addition & 7 deletions common/s2n-codec/src/decoder/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,7 @@ decoder_value!(
fn decode(buffer: Buffer) -> Result<Self> {
let len = buffer.len();
let (slice, buffer) = buffer.decode_slice(len)?;
// clippy changed identity_conversion to useless_conversion
// specify both for backwards compatibility
#[allow(
clippy::unknown_clippy_lints,
clippy::useless_conversion,
clippy::identity_conversion
)]
#[allow(clippy::useless_conversion)]
let slice = slice.into();
Ok((slice, buffer))
}
Expand Down
6 changes: 3 additions & 3 deletions netbench/netbench/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::units::{duration_format, Byte, Duration, Rate};
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Hash)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)]
#[serde(rename_all = "snake_case")]
pub enum Connection {
/// Pause for the specified duration before processing the next op
Expand Down Expand Up @@ -48,7 +48,7 @@ pub enum Connection {
Scope { threads: Vec<Vec<Connection>> },
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Hash)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)]
#[serde(rename_all = "snake_case")]
pub enum Client {
/// Pause for the specified duration before processing the next op
Expand All @@ -74,7 +74,7 @@ pub enum Client {
Scope { threads: Vec<Vec<Client>> },
}

#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Hash)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)]
#[serde(rename_all = "snake_case")]
pub enum Router {
/// Pause for the specified duration before processing the next op
Expand Down
2 changes: 1 addition & 1 deletion netbench/netbench/src/scenario/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use core::fmt;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Hash)]
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, Hash)]
pub struct Id(String);

impl Id {
Expand Down
2 changes: 1 addition & 1 deletion netbench/netbench/src/units/rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::fmt;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

#[derive(Clone, Copy, Debug, Default, PartialEq, Hash, Deserialize, Serialize)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct Rate {
pub bytes: Byte,
#[serde(with = "duration_format", rename = "period_ms")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ impl<C: connection::Trait, L: connection::Lock<C>> InterestLists<C, L> {
fn remove_node(&mut self, connection: &ConnectionNode<C, L>) {
// And remove the Connection from all other interest lists it might be
// part of.
let connection_ptr = &*connection as *const ConnectionNode<C, L>;
let connection_ptr = connection as *const ConnectionNode<C, L>;

macro_rules! remove_connection_from_list {
($list_name:ident, $link_name:ident) => {
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic-transport/src/interval_set/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl IntervalBound for VarInt {

#[inline]
fn steps_between(&self, upper: &Self) -> usize {
<u64 as IntervalBound>::steps_between(&*self, &*upper)
<u64 as IntervalBound>::steps_between(self, upper)
}

#[inline]
Expand Down
6 changes: 2 additions & 4 deletions quic/s2n-quic-transport/src/space/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,12 @@ impl<Config: endpoint::Config> PacketSpaceManager<Config> {
can_send_handshake,
early_connection_close
);
let buffer = write_packet!(
write_packet!(
buffer,
application_mut,
can_send_application,
connection_close
);

buffer
)
})
}

Expand Down

0 comments on commit f9f49dd

Please sign in to comment.