minor improvment #13
clippy
10 errors
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 10 |
Warning | 0 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.2 (25ef9e3d8 2024-04-09)
- cargo 1.77.2 (e52e36006 2024-03-26)
- clippy 0.1.77 (25ef9e3 2024-04-09)
Annotations
Check failure on line 65 in doh/src/remote/helper.rs
github-actions / clippy
unneeded `return` statement
error: unneeded `return` statement
--> doh/src/remote/helper.rs:65:5
|
65 | return Ok(fragment_connection);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
65 - return Ok(fragment_connection);
65 + Ok(fragment_connection)
|
Check failure on line 56 in doh/src/remote/helper.rs
github-actions / clippy
unneeded `return` statement
error: unneeded `return` statement
--> doh/src/remote/helper.rs:56:5
|
56 | return Ok(dial_result.stream);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
56 - return Ok(dial_result.stream);
56 + Ok(dial_result.stream)
|
Check failure on line 177 in doh/src/remote/fragment.rs
github-actions / clippy
unneeded `return` statement
error: unneeded `return` statement
--> doh/src/remote/fragment.rs:177:5
|
177 | return rng.gen_range(min..=max) as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
177 - return rng.gen_range(min..=max) as usize;
177 + rng.gen_range(min..=max) as usize
|
Check failure on line 137 in doh/src/handler.rs
github-actions / clippy
unneeded `return` statement
error: unneeded `return` statement
--> doh/src/handler.rs:137:13
|
137 | return get_response(context, cache_question, response, id, addr).await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
137 - return get_response(context, cache_question, response, id, addr).await;
137 + get_response(context, cache_question, response, id, addr).await
|
Check failure on line 32 in doh/src/context.rs
github-actions / clippy
redundant closure
error: redundant closure
--> doh/src/context.rs:32:22
|
32 | .map(|remote_session| Mutex::new(remote_session))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Mutex::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `-D clippy::redundant-closure` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`
Check failure on line 46 in doh/src/remote/mod.rs
github-actions / clippy
field `addr` is never read
error: field `addr` is never read
--> doh/src/remote/mod.rs:46:5
|
44 | struct DialResult {
| ---------- field in this struct
45 | stream: TcpStream,
46 | addr: SocketAddr,
| ^^^^
|
= note: `DialResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `-D dead-code` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(dead_code)]`
Check failure on line 42 in doh/src/helper.rs
github-actions / clippy
value assigned to `added` is never read
error: value assigned to `added` is never read
--> doh/src/helper.rs:42:13
|
42 | let mut added = 0;
| ^^^^^
|
= help: maybe it is overwritten before being read?
= note: `-D unused-assignments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_assignments)]`
Check failure on line 6 in doh/src/run.rs
github-actions / clippy
unused import: `futures::TryFutureExt`
error: unused import: `futures::TryFutureExt`
--> doh/src/run.rs:6:5
|
6 | use futures::TryFutureExt;
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D unused-imports` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_imports)]`
Check failure on line 26 in doh/src/config.rs
github-actions / clippy
use of deprecated method `rustls::client::builder::<impl rustls::ConfigBuilder<rustls::ClientConfig, rustls::client::WantsTransparencyPolicyOrClientCert>>::with_single_cert`: Use `with_client_auth_cert` instead
error: use of deprecated method `rustls::client::builder::<impl rustls::ConfigBuilder<rustls::ClientConfig, rustls::client::WantsTransparencyPolicyOrClientCert>>::with_single_cert`: Use `with_client_auth_cert` instead
--> doh/src/config.rs:26:24
|
26 | config_builder.with_single_cert(cert_chain, key_der)?
| ^^^^^^^^^^^^^^^^
|
= note: `-D deprecated` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(deprecated)]`