clippy
245 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 245 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.81.0 (eeb90cda1 2024-09-04)
- cargo 1.81.0 (2dbb1af80 2024-08-20)
- clippy 0.1.81 (eeb90cd 2024-09-04)
Annotations
Check warning on line 16 in src/plugins/location/remotehttp/mod.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> src/plugins/location/remotehttp/mod.rs:16:1
|
16 | pub mod remotehttp;
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
Check warning on line 60 in src/plugins/location/local/local.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/plugins/location/local/local.rs:60:9
|
60 | return self.loc_cache.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
60 - return self.loc_cache.clone();
60 + self.loc_cache.clone()
|
Check warning on line 16 in src/plugins/location/local/mod.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> src/plugins/location/local/mod.rs:16:1
|
16 | pub mod local;
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
Check warning on line 158 in src/plugins/loadbalance/roundrobin/roundrobin.rs
github-actions / clippy
returning the result of a `let` binding from a block
warning: returning the result of a `let` binding from a block
--> src/plugins/loadbalance/roundrobin/roundrobin.rs:158:9
|
154 | / let cur_weight = self.cur_weight.fetch_add(
155 | | self.weight.load(std::sync::atomic::Ordering::Relaxed),
156 | | std::sync::atomic::Ordering::Relaxed,
157 | | );
| |__________- unnecessary `let` binding
158 | cur_weight
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
154 ~
155 ~ self.cur_weight.fetch_add(
156 + self.weight.load(std::sync::atomic::Ordering::Relaxed),
157 + std::sync::atomic::Ordering::Relaxed,
158 + )
|
Check warning on line 96 in src/plugins/loadbalance/roundrobin/roundrobin.rs
github-actions / clippy
you seem to use `.enumerate()` and immediately discard the index
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/loadbalance/roundrobin/roundrobin.rs:96:25
|
96 | for (_, ins) in instances.instances.iter().enumerate() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
help: remove the `.enumerate()` call
|
96 | for ins in instances.instances.iter() {
| ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
Check warning on line 73 in src/plugins/loadbalance/roundrobin/roundrobin.rs
github-actions / clippy
casting to the same type is unnecessary (`u32` -> `u32`)
warning: casting to the same type is unnecessary (`u32` -> `u32`)
--> src/plugins/loadbalance/roundrobin/roundrobin.rs:73:72
|
73 | ... .or_insert_with(|| WeightedRoundRobin::new(instance.weight as u32));
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `instance.weight`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Check warning on line 16 in src/plugins/loadbalance/roundrobin/mod.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> src/plugins/loadbalance/roundrobin/mod.rs:16:1
|
16 | pub mod roundrobin;
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
Check warning on line 16 in src/plugins/loadbalance/ringhash/mod.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> src/plugins/loadbalance/ringhash/mod.rs:16:1
|
16 | pub mod ringhash;
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
Check warning on line 16 in src/plugins/loadbalance/random/mod.rs
github-actions / clippy
module has the same name as its containing module
warning: module has the same name as its containing module
--> src/plugins/loadbalance/random/mod.rs:16:1
|
16 | pub mod random;
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
Check warning on line 166 in src/plugins/filter/configcrypto/crypto.rs
github-actions / clippy
unneeded late initialization
warning: unneeded late initialization
--> src/plugins/filter/configcrypto/crypto.rs:166:9
|
166 | let data_key: String;
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: move the declaration `data_key` here and remove the assignments from the `match` arms
|
166 ~
167 ~ let data_key: String = match encrypt_data_key {
168 | Ok(key) => {
169 ~ key
170 | }
...
178 | .unwrap();
179 ~ String::from_utf8(u8_slice).unwrap()
180 | }
181 ~ };
|
Check warning on line 111 in src/plugins/filter/configcrypto/crypto.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/plugins/filter/configcrypto/crypto.rs:108:25
|
108 | pub fn builder() -> (
| _________________________^
109 | | fn(serde_yaml::Value) -> Result<Box<dyn DiscoverFilter>, PolarisError>,
110 | | String,
111 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
Check warning on line 70 in src/plugins/filter/configcrypto/crypto.rs
github-actions / clippy
you seem to use `.enumerate()` and immediately discard the index
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/filter/configcrypto/crypto.rs:70:20
|
70 | for (_k, v) in conf.entries.iter().enumerate() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
help: remove the `.enumerate()` call
|
70 | for v in conf.entries.iter() {
| ~ ~~~~~~~~~~~~~~~~~~~
Check warning on line 789 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/plugins/connector/grpc/connector.rs:789:9
|
789 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
789 - return Ok(());
789 + Ok(())
|
Check warning on line 731 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/plugins/connector/grpc/connector.rs:731:9
|
731 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
731 - return Ok(());
731 + Ok(())
|
Check warning on line 350 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
you seem to use `.enumerate()` and immediately discard the index
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/connector/grpc/connector.rs:350:29
|
350 | for (_i, filter) in filters.iter().enumerate() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
help: remove the `.enumerate()` call
|
350 | for filter in filters.iter() {
| ~~~~~~ ~~~~~~~~~~~~~~
Check warning on line 318 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
you seem to use `.enumerate()` and immediately discard the index
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/connector/grpc/connector.rs:318:29
|
318 | for (_i, filter) in filters.iter().enumerate() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
help: remove the `.enumerate()` call
|
318 | for filter in filters.iter() {
| ~~~~~~ ~~~~~~~~~~~~~~
Check warning on line 214 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/plugins/connector/grpc/connector.rs:214:9
|
214 | return (new_connector, "grpc".to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
214 - return (new_connector, "grpc".to_string());
214 + (new_connector, "grpc".to_string())
|
Check warning on line 213 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/plugins/connector/grpc/connector.rs:213:25
|
213 | pub fn builder() -> (fn(opt: InitConnectorOption) -> Box<dyn Connector>, String) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
Check warning on line 185 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
using `clone` on type `Duration` which implements the `Copy` trait
warning: using `clone` on type `Duration` which implements the `Copy` trait
--> src/plugins/connector/grpc/connector.rs:185:30
|
185 | .connect_timeout(connect_timeout.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `connect_timeout`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 180 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
using `clone` on type `Duration` which implements the `Copy` trait
warning: using `clone` on type `Duration` which implements the `Copy` trait
--> src/plugins/connector/grpc/connector.rs:180:30
|
180 | .connect_timeout(connect_timeout.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `connect_timeout`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 164 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
`to_string` applied to a type that implements `Display` in `format!` args
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/plugins/connector/grpc/connector.rs:164:52
|
164 | ele.trim_start_matches("config://").to_string()
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
Check warning on line 159 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
`to_string` applied to a type that implements `Display` in `format!` args
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/plugins/connector/grpc/connector.rs:159:54
|
159 | ele.trim_start_matches("discover://").to_string()
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: `#[warn(clippy::to_string_in_format_args)]` on by default
Check warning on line 137 in src/plugins/connector/grpc/connector.rs
github-actions / clippy
called `unwrap` on `discover_request` after checking its variant with `is_some`
warning: called `unwrap` on `discover_request` after checking its variant with `is_some`
--> src/plugins/connector/grpc/connector.rs:137:61
|
136 | if discover_request.is_some() {
| ----------------------------- help: try: `if let Some(..) = discover_request`
137 | send_c.send_naming_discover_request(discover_request.unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
Check warning on line 742 in src/plugins/cache/memory/memory.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> src/plugins/cache/memory/memory.rs:742:66
|
742 | let listeners = safe_map.entry(watch_key).or_insert_with(|| Vec::new());
| ^^^^^^^^^^^^^ help: replace the closure with the function itself: `Vec::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
Check warning on line 717 in src/plugins/cache/memory/memory.rs
github-actions / clippy
returning the result of a `let` binding from a block
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:717:13
|
716 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
717 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
716 ~
717 ~ cache_val.wait_initialize(filter.timeout).await
|