Skip to content

Commit 35dd224

Browse files
ci: remove exceptions for clippy (#2726)
* ci: remove exceptions for clippy * fix inline format args * fix inline format args
1 parent 5855e53 commit 35dd224

File tree

9 files changed

+16
-21
lines changed

9 files changed

+16
-21
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,7 @@ jobs:
120120
# TODO translate json reports to in-action warnings
121121
- name: Run cargo clippy
122122
run: |
123-
# deriving Eq may break API compatibility so we disable it
124-
# See https://github.com/rust-lang/rust-clippy/issues/9063
125-
#
126-
# manual_clamp will panic when min > max
127-
# See https://github.com/rust-lang/rust-clippy/pull/10101
128-
cargo clippy --all-features --all-targets --workspace -- -A clippy::derive_partial_eq_without_eq -A clippy::manual_clamp ${{ matrix.args }}
123+
cargo clippy --all-features --all-targets --workspace -- ${{ matrix.args }}
129124
130125
udeps:
131126
runs-on: ubuntu-latest
@@ -529,7 +524,7 @@ jobs:
529524

530525
- name: lint
531526
working-directory: ${{ matrix.example }}
532-
run: cargo clippy --all-features --all-targets -- -A clippy::manual_clamp -A clippy::uninlined_format_args -D warnings
527+
run: cargo clippy --all-features --all-targets -- -D warnings
533528

534529
# not all examples will build with the --manifest-path argument, since the
535530
# manifest-path argument will pull configuration from the current directory

examples/async-client-hello-callback/src/bin/quic_async_client_hello_callback_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl ClientHelloCallback for ConfigCache {
6464
.cache
6565
.get_with(sni.clone(), || Arc::new(OnceCell::new()));
6666
if let Some(config) = once_cell_config.get() {
67-
eprintln!("Config already cached for SNI: {}", sni);
67+
eprintln!("Config already cached for SNI: {sni}");
6868
connection.set_config(config.clone())?;
6969
// return `None` if the Config is already in the cache
7070
return Ok(None);
@@ -84,7 +84,7 @@ impl ClientHelloCallback for ConfigCache {
8484
return Err(S2nError::application(Box::new(CustomError)));
8585
}
8686

87-
eprintln!("resolving certificate for SNI: {}", sni);
87+
eprintln!("resolving certificate for SNI: {sni}");
8888

8989
// load the cert and key file asynchronously.
9090
let (cert, key) = {

examples/event-framework/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub mod print_event {
2323
meta: &ConnectionMeta,
2424
info: &event::ConnectionInfo,
2525
) -> Self::ConnectionContext {
26-
println!("{:?} {:?}", meta, info);
26+
println!("{meta:?} {info:?}");
2727
}
2828

2929
/// This event fires for all events.
@@ -33,7 +33,7 @@ pub mod print_event {
3333
event: &E,
3434
) {
3535
if self.print_all_events {
36-
println!("event: {:?} {:?}", meta, event);
36+
println!("event: {meta:?} {event:?}");
3737
}
3838
}
3939

@@ -47,7 +47,7 @@ pub mod print_event {
4747
event: &E,
4848
) {
4949
if self.print_connection_events {
50-
println!("connection_event: {:?} {:?} {:?}", context, meta, event);
50+
println!("connection_event: {context:?} {meta:?} {event:?}");
5151
}
5252
}
5353
}
@@ -110,7 +110,7 @@ pub mod query_event {
110110
impl Drop for MyQueryContext {
111111
// Execute some operations on the context before the Connection is dropped.
112112
fn drop(&mut self) {
113-
println!("{:?}", self);
113+
println!("{self:?}");
114114
}
115115
}
116116
}

examples/jumbo-frame/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ impl Subscriber for MtuEventInformer {
2424
_meta: &s2n_quic::provider::event::ConnectionMeta,
2525
event: &s2n_quic::provider::event::events::MtuUpdated,
2626
) {
27-
eprintln!("{:?}", event);
27+
eprintln!("{event:?}");
2828
}
2929
}

examples/post-quantum/src/bin/pq_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
3535

3636
// respond to the client with our own message
3737
if let Ok(Some(data)) = stream.receive().await {
38-
eprintln!("message from the client: {:?}", data);
38+
eprintln!("message from the client: {data:?}");
3939
let _ = stream.write_all(b"hello post-quantum client!\n").await;
4040
}
4141
});

examples/rustls-mtls/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ impl MtlsProvider {
105105
async fn read_file(path: &Path) -> Result<Vec<u8>, RustlsError> {
106106
let mut f = File::open(path)
107107
.await
108-
.map_err(|e| RustlsError::General(format!("Failed to load file: {}", e)))?;
108+
.map_err(|e| RustlsError::General(format!("Failed to load file: {e}")))?;
109109
let mut buf = Vec::new();
110110
f.read_to_end(&mut buf)
111111
.await
112-
.map_err(|e| RustlsError::General(format!("Failed to read file: {}", e)))?;
112+
.map_err(|e| RustlsError::General(format!("Failed to read file: {e}")))?;
113113
Ok(buf)
114114
}
115115

examples/unreliable-datagram/src/bin/datagram_receiver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ async fn main() -> Result<(), Box<dyn Error>> {
5858
.await;
5959

6060
match recv_result {
61-
Ok(value) => eprintln!("RECV {:?}", value),
61+
Ok(value) => eprintln!("RECV {value:?}"),
6262
Err(err) => {
63-
eprintln!("{:?}", err);
63+
eprintln!("{err:?}");
6464
return Ok(());
6565
}
6666
}

examples/unreliable-datagram/src/bin/datagram_sender.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
4747
// The datagram was successfully inserted into the send queue
4848
}
4949
Err(err) => {
50-
eprintln!("{}", err);
50+
eprintln!("{err}");
5151
// An error was encountered while calling the send_datagram
5252
// method. Either the peer didn't advertise support for datagrams
5353
// or the send queue is at capacity.

scripts/local_test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
set -e
1111

1212
cargo +nightly fmt --all -- --check
13-
cargo +stable clippy --all-features --all-targets -- -D warnings -A clippy::derive_partial_eq_without_eq -A clippy::manual_clamp -A clippy::uninlined_format_args
13+
cargo +stable clippy --all-features --all-targets -- -D warnings
1414
cargo test

0 commit comments

Comments
 (0)