docs:完善Cargo.toml内容 #5
Annotations
269 warnings
RustFmt check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
RustFmt check
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/cache@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
RustFmt check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
RustFmt check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
RustFmt check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
RustFmt check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
module has the same name as its containing module:
src/plugins/location/remotehttp/mod.rs#L16
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
|
unneeded `return` statement:
src/plugins/location/local/local.rs#L60
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()
|
|
module has the same name as its containing module:
src/plugins/location/local/mod.rs#L16
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
|
returning the result of a `let` binding from a block:
src/plugins/loadbalance/roundrobin/roundrobin.rs#L158
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 + )
|
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/loadbalance/roundrobin/roundrobin.rs#L96
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() {
| ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
casting to the same type is unnecessary (`u32` -> `u32`):
src/plugins/loadbalance/roundrobin/roundrobin.rs#L73
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
|
module has the same name as its containing module:
src/plugins/loadbalance/roundrobin/mod.rs#L16
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
|
module has the same name as its containing module:
src/plugins/loadbalance/ringhash/mod.rs#L16
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
|
module has the same name as its containing module:
src/plugins/loadbalance/random/mod.rs#L16
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
|
unneeded late initialization:
src/plugins/filter/configcrypto/crypto.rs#L166
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 ~ };
|
|
very complex type used. Consider factoring parts into `type` definitions:
src/plugins/filter/configcrypto/crypto.rs#L108
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
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/filter/configcrypto/crypto.rs#L70
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() {
| ~ ~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/plugins/connector/grpc/connector.rs#L789
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(())
|
|
unneeded `return` statement:
src/plugins/connector/grpc/connector.rs#L731
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(())
|
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/connector/grpc/connector.rs#L350
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() {
| ~~~~~~ ~~~~~~~~~~~~~~
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/connector/grpc/connector.rs#L318
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() {
| ~~~~~~ ~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/plugins/connector/grpc/connector.rs#L214
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())
|
|
very complex type used. Consider factoring parts into `type` definitions:
src/plugins/connector/grpc/connector.rs#L213
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
|
using `clone` on type `Duration` which implements the `Copy` trait:
src/plugins/connector/grpc/connector.rs#L185
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
|
using `clone` on type `Duration` which implements the `Copy` trait:
src/plugins/connector/grpc/connector.rs#L180
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
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/plugins/connector/grpc/connector.rs#L164
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
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/plugins/connector/grpc/connector.rs#L159
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
|
called `unwrap` on `discover_request` after checking its variant with `is_some`:
src/plugins/connector/grpc/connector.rs#L137
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
|
redundant closure:
src/plugins/cache/memory/memory.rs#L742
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
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L717
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
|
|
using `clone` on type `Option<u64>` which implements the `Copy` trait:
src/plugins/cache/memory/memory.rs#L691
warning: using `clone` on type `Option<u64>` which implements the `Copy` trait
--> src/plugins/cache/memory/memory.rs:691:22
|
691 | version: spec_conf.version.clone().unwrap(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `spec_conf.version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L667
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:667:13
|
666 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
667 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
666 ~
667 ~ cache_val.wait_initialize(filter.timeout).await
|
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L625
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:625:13
|
624 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
625 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
624 ~
625 ~ cache_val.wait_initialize(filter.timeout).await
|
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L581
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:581:13
|
580 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
581 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
580 ~
581 ~ cache_val.wait_initialize(filter.timeout).await
|
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L536
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:536:21
|
535 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
536 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
535 ~
536 ~ cache_val.wait_initialize(filter.timeout).await
|
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L500
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:500:21
|
499 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
500 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
499 ~
500 ~ cache_val.wait_initialize(filter.timeout).await
|
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L464
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:464:21
|
463 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
464 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
463 ~
464 ~ cache_val.wait_initialize(filter.timeout).await
|
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/cache/memory/memory.rs#L439
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/cache/memory/memory.rs:439:33
|
439 | for (_, val) in cache_val.value.read().await.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
|
439 | for val in cache_val.value.read().await.iter() {
| ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
returning the result of a `let` binding from a block:
src/plugins/cache/memory/memory.rs#L424
warning: returning the result of a `let` binding from a block
--> src/plugins/cache/memory/memory.rs:424:21
|
423 | let waiter = cache_val.wait_initialize(filter.timeout).await;
| ------------------------------------------------------------- unnecessary `let` binding
424 | waiter
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
423 ~
424 ~ cache_val.wait_initialize(filter.timeout).await
|
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/cache/memory/memory.rs#L351
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/cache/memory/memory.rs:351:39
|
351 | for (_index, listener) in expect_watcher.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
|
351 | for listener in expect_watcher.iter() {
| ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
|
you seem to use `.enumerate()` and immediately discard the index:
src/plugins/cache/memory/memory.rs#L161
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/plugins/cache/memory/memory.rs:161:33
|
161 | for (_, val) in remote_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
|
161 | for val in remote_instances.iter() {
| ~~~ ~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/plugins/cache/memory/memory.rs#L72
warning: unneeded `return` statement
--> src/plugins/cache/memory/memory.rs:72:9
|
72 | return (new_resource_cache, "memory".to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
72 - return (new_resource_cache, "memory".to_string());
72 + (new_resource_cache, "memory".to_string())
|
|
very complex type used. Consider factoring parts into `type` definitions:
src/plugins/cache/memory/memory.rs#L68
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/plugins/cache/memory/memory.rs:68:25
|
68 | pub fn builder() -> (
| _________________________^
69 | | fn(InitResourceCacheOption) -> Box<dyn ResourceCache>,
70 | | String,
71 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/plugins/cache/memory/memory.rs#L40
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/plugins/cache/memory/memory.rs:40:16
|
40 | listeners: Arc<RwLock<HashMap<EventType, Vec<Arc<dyn ResourceListener>>>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
module has the same name as its containing module:
src/plugins/cache/memory/mod.rs#L15
warning: module has the same name as its containing module
--> src/plugins/cache/memory/mod.rs:15:1
|
15 | pub mod memory;
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
|
redundant closure:
src/discovery/default.rs#L242
warning: redundant closure
--> src/discovery/default.rs:242:29
|
242 | .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
|
this match expression is unnecessary:
src/discovery/default.rs#L215
warning: this match expression is unnecessary
--> src/discovery/default.rs:215:9
|
215 | / match rsp {
216 | | Ok(rsp) => Ok(rsp),
217 | | Err(e) => Err(e),
218 | | }
| |_________^ help: replace it with: `rsp`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match
|
this block may be rewritten with the `?` operator:
src/discovery/default.rs#L208
warning: this block may be rewritten with the `?` operator
--> src/discovery/default.rs:208:9
|
208 | / if let Err(e) = check_ret {
209 | | return Err(e);
210 | | }
| |_________^ help: replace it with: `check_ret?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
|
this match expression is unnecessary:
src/discovery/default.rs#L197
warning: this match expression is unnecessary
--> src/discovery/default.rs:197:9
|
197 | / match rsp {
198 | | Ok(rsp) => Ok(rsp),
199 | | Err(e) => Err(e),
200 | | }
| |_________^ help: replace it with: `rsp`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match
= note: `#[warn(clippy::needless_match)]` on by default
|
this block may be rewritten with the `?` operator:
src/discovery/default.rs#L180
warning: this block may be rewritten with the `?` operator
--> src/discovery/default.rs:180:9
|
180 | / if let Err(e) = check_ret {
181 | | return Err(e);
182 | | }
| |_________^ help: replace it with: `check_ret?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
|
using `clone` on type `Duration` which implements the `Copy` trait:
src/discovery/default.rs#L125
warning: using `clone` on type `Duration` which implements the `Copy` trait
--> src/discovery/default.rs:125:30
|
125 | timeout: req.timeout.clone(),
| ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `req.timeout`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
this block may be rewritten with the `?` operator:
src/discovery/default.rs#L116
warning: this block may be rewritten with the `?` operator
--> src/discovery/default.rs:116:9
|
116 | / if let Err(e) = check_ret {
117 | | return Err(e);
118 | | }
| |_________^ help: replace it with: `check_ret?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
= note: `#[warn(clippy::question_mark)]` on by default
|
calling `push_str()` using a single-character string literal:
src/discovery/default.rs#L59
warning: calling `push_str()` using a single-character string literal
--> src/discovery/default.rs:59:9
|
59 | watch_key.push_str("#");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `watch_key.push('#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
unneeded `return` statement:
src/discovery/req.rs#L318
warning: unneeded `return` statement
--> src/discovery/req.rs:318:9
|
318 | return format!("{}#{}", namespace, service);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
318 - return format!("{}#{}", namespace, service);
318 + format!("{}#{}", namespace, service)
|
|
unneeded `return` statement:
src/discovery/req.rs#L166
warning: unneeded `return` statement
--> src/discovery/req.rs:166:9
|
166 | return format!("{}_{}_{}_{}_{}", namespace, service, ip, port, vpc_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
166 - return format!("{}_{}_{}_{}_{}", namespace, service, ip, port, vpc_id);
166 + format!("{}_{}_{}_{}_{}", namespace, service, ip, port, vpc_id)
|
|
using `clone` on type `Duration` which implements the `Copy` trait:
src/discovery/req.rs#L135
warning: using `clone` on type `Duration` which implements the `Copy` trait
--> src/discovery/req.rs:135:22
|
135 | timeout: self.timeout.clone(),
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.timeout`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/discovery/req.rs#L118
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/discovery/req.rs:118:19
|
118 | port: self.port.clone(),
| ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `Duration` which implements the `Copy` trait:
src/discovery/req.rs#L84
warning: using `clone` on type `Duration` which implements the `Copy` trait
--> src/discovery/req.rs:84:22
|
84 | timeout: self.timeout.clone(),
| ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.timeout`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/discovery/req.rs#L74
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/discovery/req.rs:74:23
|
74 | priority: self.priority.clone(),
| ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.priority`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/discovery/req.rs#L73
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/discovery/req.rs:73:21
|
73 | weight: self.weight.clone(),
| ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.weight`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `bool` which implements the `Copy` trait:
src/discovery/req.rs#L72
warning: using `clone` on type `bool` which implements the `Copy` trait
--> src/discovery/req.rs:72:23
|
72 | isolated: self.isolated.clone(),
| ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.isolated`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `bool` which implements the `Copy` trait:
src/discovery/req.rs#L71
warning: using `clone` on type `bool` which implements the `Copy` trait
--> src/discovery/req.rs:71:21
|
71 | health: self.health.clone(),
| ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.health`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/discovery/req.rs#L67
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/discovery/req.rs:67:19
|
67 | port: self.port.clone(),
| ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
accessing first element with `conf.global.server_connectors.addresses.get(0)`:
src/core/plugin/plugins.rs#L294
warning: accessing first element with `conf.global.server_connectors.addresses.get(0)`
--> src/core/plugin/plugins.rs:294:16
|
294 | let host = conf.global.server_connectors.addresses.get(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `conf.global.server_connectors.addresses.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
|
unneeded `return` statement:
src/core/plugin/plugins.rs#L314
warning: unneeded `return` statement
--> src/core/plugin/plugins.rs:314:13
|
314 | return uuid::Uuid::new_v4().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
314 - return uuid::Uuid::new_v4().to_string();
314 + uuid::Uuid::new_v4().to_string()
|
|
unneeded `return` statement:
src/core/plugin/plugins.rs#L310
warning: unneeded `return` statement
--> src/core/plugin/plugins.rs:310:17
|
310 | return uuid::Uuid::new_v4().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
310 - return uuid::Uuid::new_v4().to_string();
310 + uuid::Uuid::new_v4().to_string()
|
|
unneeded `return` statement:
src/core/plugin/plugins.rs#L303
warning: unneeded `return` statement
--> src/core/plugin/plugins.rs:303:21
|
303 | return format!("{}_{}_{}", ipv4, std::process::id(), seq);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
303 - return format!("{}_{}_{}", ipv4, std::process::id(), seq);
303 + format!("{}_{}_{}", ipv4, std::process::id(), seq)
|
|
unneeded `return` statement:
src/core/plugin/plugins.rs#L210
warning: unneeded `return` statement
--> src/core/plugin/plugins.rs:210:9
|
210 | return c;
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
210 - return c;
210 + c
|
|
very complex type used. Consider factoring parts into `type` definitions:
src/core/plugin/plugins.rs#L196
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/core/plugin/plugins.rs:196:9
|
196 | HashMap<String, fn(serde_yaml::Value) -> Result<Box<dyn DiscoverFilter>, PolarisError>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/core/plugin/plugins.rs#L194
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/core/plugin/plugins.rs:194:13
|
194 | caches: HashMap<String, fn(InitResourceCacheOption) -> Box<dyn ResourceCache>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/core/plugin/plugins.rs#L193
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/core/plugin/plugins.rs:193:14
|
193 | routers: HashMap<String, fn(&Configuration) -> Box<dyn ServiceRouter>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/core/plugin/plugins.rs#L192
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/core/plugin/plugins.rs:192:17
|
192 | connectors: HashMap<String, fn(InitConnectorOption) -> Box<dyn Connector>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
you seem to use `.enumerate()` and immediately discard the index:
src/core/plugin/plugins.rs#L165
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/core/plugin/plugins.rs:165:31
|
165 | for (_i, name) in filter_conf.chain.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
|
165 | for name in filter_conf.chain.iter() {
| ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/core/plugin/location.rs#L103
warning: unneeded `return` statement
--> src/core/plugin/location.rs:103:9
|
103 | return Location::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
103 - return Location::default();
103 + Location::default()
|
|
this `impl` can be derived:
src/core/plugin/connector.rs#L93
warning: this `impl` can be derived
--> src/core/plugin/connector.rs:93:1
|
93 | / impl Default for NoopConnector {
94 | | fn default() -> Self {
95 | | Self {}
96 | | }
97 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= help: remove the manual implementation...
help: ...and instead derive it
|
91 + #[derive(Default)]
92 | pub struct NoopConnector {}
|
|
this `impl` can be derived:
src/core/plugin/cache.rs#L85
warning: this `impl` can be derived
--> src/core/plugin/cache.rs:85:1
|
85 | / impl Default for NoopResourceCache {
86 | | fn default() -> Self {
87 | | Self {}
88 | | }
89 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
83 + #[derive(Default)]
84 | pub struct NoopResourceCache {}
|
|
using `clone` on type `EventType` which implements the `Copy` trait:
src/core/plugin/cache.rs#L39
warning: using `clone` on type `EventType` which implements the `Copy` trait
--> src/core/plugin/cache.rs:39:9
|
39 | self.resource_key.event_type.clone()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.resource_key.event_type`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
useless conversion to the same type: `core::model::pb::lib::ConfigDiscoverResponse`:
src/core/model/mod.rs#L58
warning: useless conversion to the same type: `core::model::pb::lib::ConfigDiscoverResponse`
--> src/core/model/mod.rs:58:58
|
58 | DiscoverResponseInfo::Configuration(resp) => resp.clone().into(),
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `resp.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
large size difference between variants:
src/core/model/mod.rs#L49
warning: large size difference between variants
--> src/core/model/mod.rs:49:1
|
49 | / pub enum DiscoverResponseInfo {
50 | | Unknown,
51 | | Naming(DiscoverResponse),
| | ------------------------ the largest variant contains at least 2008 bytes
52 | | Configuration(ConfigDiscoverResponse),
| | ------------------------------------- the second-largest variant contains at least 344 bytes
53 | | }
| |_^ the entire enum is at least 2008 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
|
51 | Naming(Box<DiscoverResponse>),
| ~~~~~~~~~~~~~~~~~~~~~
|
useless conversion to the same type: `core::model::pb::lib::ConfigDiscoverRequest`:
src/core/model/mod.rs#L40
warning: useless conversion to the same type: `core::model::pb::lib::ConfigDiscoverRequest`
--> src/core/model/mod.rs:40:56
|
40 | DiscoverRequestInfo::Configuration(req) => req.clone().into(),
| ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `req.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
large size difference between variants:
src/core/model/mod.rs#L31
warning: large size difference between variants
--> src/core/model/mod.rs:31:1
|
31 | / pub enum DiscoverRequestInfo {
32 | | Unknown,
33 | | Naming(DiscoverRequest),
| | ----------------------- the largest variant contains at least 584 bytes
34 | | Configuration(ConfigDiscoverRequest),
| | ------------------------------------ the second-largest variant contains at least 272 bytes
35 | | }
| |_^ the entire enum is at least 584 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
|
33 | Naming(Box<DiscoverRequest>),
| ~~~~~~~~~~~~~~~~~~~~
|
all variants have the same prefix: `MetadataFailover`:
src/core/model/router.rs#L21
warning: all variants have the same prefix: `MetadataFailover`
--> src/core/model/router.rs:21:1
|
21 | / enum MetadataFailoverType {
22 | | MetadataFailoverNone,
23 | | MetadataFailoverAll,
24 | | MetadataFailoverNoKey,
25 | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
|
unneeded `return` statement:
src/core/model/naming.rs#L298
warning: unneeded `return` statement
--> src/core/model/naming.rs:298:9
|
298 | return ret;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
298 - return ret;
298 + ret
|
|
using `clone` on type `u32` which implements the `Copy` trait:
src/core/model/naming.rs#L277
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/core/model/naming.rs:277:31
|
277 | ttl: Some(self.ttl.clone()),
| ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.ttl`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `bool` which implements the `Copy` trait:
src/core/model/naming.rs#L261
warning: using `clone` on type `bool` which implements the `Copy` trait
--> src/core/model/naming.rs:261:27
|
261 | isolate: Some(self.instance.isolated.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.instance.isolated`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `bool` which implements the `Copy` trait:
src/core/model/naming.rs#L260
warning: using `clone` on type `bool` which implements the `Copy` trait
--> src/core/model/naming.rs:260:27
|
260 | healthy: Some(self.instance.health.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.instance.health`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/core/model/naming.rs#L257
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/core/model/naming.rs:257:26
|
257 | weight: Some(self.instance.weight.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.instance.weight`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/core/model/naming.rs#L256
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/core/model/naming.rs:256:28
|
256 | priority: Some(self.instance.priority.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.instance.priority`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/core/model/naming.rs#L253
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/core/model/naming.rs:253:24
|
253 | port: Some(self.instance.port.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.instance.port`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
unneeded `return` statement:
src/core/model/naming.rs#L281
warning: unneeded `return` statement
--> src/core/model/naming.rs:281:9
|
281 | return spec_ins;
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
281 - return spec_ins;
281 + spec_ins
|
|
using `clone` on type `u32` which implements the `Copy` trait:
src/core/model/naming.rs#L213
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/core/model/naming.rs:213:24
|
213 | port: Some(self.instance.port.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.instance.port`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
method `clone` can be confused for the standard trait method `std::clone::Clone::clone`:
src/core/model/naming.rs#L157
warning: method `clone` can be confused for the standard trait method `std::clone::Clone::clone`
--> src/core/model/naming.rs:157:5
|
157 | / pub fn clone(&self) -> Location {
158 | | Self {
159 | | region: self.region.clone(),
160 | | zone: self.zone.clone(),
161 | | campus: self.campus.clone(),
162 | | }
163 | | }
| |_____^
|
= help: consider implementing the trait `std::clone::Clone` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
unneeded `return` statement:
src/core/model/naming.rs#L115
warning: unneeded `return` statement
--> src/core/model/naming.rs:115:9
|
115 | return true;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
115 - return true;
115 + true
|
|
you seem to use `.enumerate()` and immediately discard the index:
src/core/model/naming.rs#L65
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/core/model/naming.rs:65:25
|
65 | for (_, val) in all_ins.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
|
65 | for val in all_ins.iter() {
| ~~~ ~~~~~~~~~~~~~~
|
you seem to use `.enumerate()` and immediately discard the index:
src/core/model/config.rs#L161
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/core/model/config.rs:161:24
|
161 | for (_k, v) in self.tags.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
|
161 | for v in self.tags.iter() {
| ~ ~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/core/model/config.rs#L167
warning: unneeded `return` statement
--> src/core/model/config.rs:167:9
|
167 | return "".to_string();
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
167 - return "".to_string();
167 + "".to_string()
|
|
you seem to use `.enumerate()` and immediately discard the index:
src/core/model/config.rs#L151
warning: you seem to use `.enumerate()` and immediately discard the index
--> src/core/model/config.rs:151:24
|
151 | for (_k, v) in self.tags.iter().enumerate() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
= note: `#[warn(clippy::unused_enumerate_index)]` on by default
help: remove the `.enumerate()` call
|
151 | for v in self.tags.iter() {
| ~ ~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
src/core/model/config.rs#L157
warning: unneeded `return` statement
--> src/core/model/config.rs:157:9
|
157 | return "".to_string();
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
157 - return "".to_string();
157 + "".to_string()
|
|
all variants have the same prefix: `Ret`:
src/core/model/circuitbreaker.rs#L33
warning: all variants have the same prefix: `Ret`
--> src/core/model/circuitbreaker.rs:33:1
|
33 | / enum RetStatus {
34 | | RetUnknown,
35 | | RetSuccess,
36 | | RetFail,
... |
39 | | RetFlowControl,
40 | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= note: `#[warn(clippy::enum_variant_names)]` on by default
|
using `clone` on type `Option<u64>` which implements the `Copy` trait:
src/core/model/cache.rs#L782
warning: using `clone` on type `Option<u64>` which implements the `Copy` trait
--> src/core/model/cache.rs:782:22
|
782 | version: self.value.version.clone().unwrap_or_default(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.value.version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
you should consider adding a `Default` implementation for `ConfigFileCacheItem`:
src/core/model/cache.rs#L764
warning: you should consider adding a `Default` implementation for `ConfigFileCacheItem`
--> src/core/model/cache.rs:764:5
|
764 | / pub fn new() -> Self {
765 | | Self {
766 | | initialized: Arc::new(AtomicBool::new(false)),
767 | | value: ClientConfigFileInfo::default(),
768 | | revision: String::new(),
769 | | }
770 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
763 + impl Default for ConfigFileCacheItem {
764 + fn default() -> Self {
765 + Self::new()
766 + }
767 + }
|
|
you should consider adding a `Default` implementation for `ConfigGroupCacheItem`:
src/core/model/cache.rs#L701
warning: you should consider adding a `Default` implementation for `ConfigGroupCacheItem`
--> src/core/model/cache.rs:701:5
|
701 | / pub fn new() -> Self {
702 | | Self {
703 | | initialized: Arc::new(AtomicBool::new(false)),
704 | | namespace: String::new(),
... |
708 | | }
709 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
700 + impl Default for ConfigGroupCacheItem {
701 + fn default() -> Self {
702 + Self::new()
703 + }
704 + }
|
|
you should consider adding a `Default` implementation for `FaultDetectRulesCacheItem`:
src/core/model/cache.rs#L640
warning: you should consider adding a `Default` implementation for `FaultDetectRulesCacheItem`
--> src/core/model/cache.rs:640:5
|
640 | / pub fn new() -> Self {
641 | | Self {
642 | | initialized: Arc::new(AtomicBool::new(false)),
643 | | value: FaultDetector::default(),
644 | | revision: String::new(),
645 | | }
646 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
639 + impl Default for FaultDetectRulesCacheItem {
640 + fn default() -> Self {
641 + Self::new()
642 + }
643 + }
|
|
you should consider adding a `Default` implementation for `CircuitBreakerRulesCacheItem`:
src/core/model/cache.rs#L581
warning: you should consider adding a `Default` implementation for `CircuitBreakerRulesCacheItem`
--> src/core/model/cache.rs:581:5
|
581 | / pub fn new() -> Self {
582 | | Self {
583 | | initialized: Arc::new(AtomicBool::new(false)),
584 | | value: CircuitBreaker::default(),
585 | | revision: String::new(),
586 | | }
587 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
580 + impl Default for CircuitBreakerRulesCacheItem {
581 + fn default() -> Self {
582 + Self::new()
583 + }
584 + }
|
|
you should consider adding a `Default` implementation for `RatelimitRulesCacheItem`:
src/core/model/cache.rs#L522
warning: you should consider adding a `Default` implementation for `RatelimitRulesCacheItem`
--> src/core/model/cache.rs:522:5
|
522 | / pub fn new() -> Self {
523 | | Self {
524 | | initialized: Arc::new(AtomicBool::new(false)),
525 | | value: RateLimit::default(),
526 | | revision: String::new(),
527 | | }
528 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
521 + impl Default for RatelimitRulesCacheItem {
522 + fn default() -> Self {
523 + Self::new()
524 + }
525 + }
|
|
you should consider adding a `Default` implementation for `RouterRulesCacheItem`:
src/core/model/cache.rs#L423
warning: you should consider adding a `Default` implementation for `RouterRulesCacheItem`
--> src/core/model/cache.rs:423:5
|
423 | / pub fn new() -> Self {
424 | | Self {
425 | | initialized: Arc::new(AtomicBool::new(false)),
426 | | value: Arc::new(RwLock::new(Vec::new())),
427 | | revision: String::new(),
428 | | }
429 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
422 + impl Default for RouterRulesCacheItem {
423 + fn default() -> Self {
424 + Self::new()
425 + }
426 + }
|
|
you should consider adding a `Default` implementation for `ServiceInstancesCacheItem`:
src/core/model/cache.rs#L344
warning: you should consider adding a `Default` implementation for `ServiceInstancesCacheItem`
--> src/core/model/cache.rs:344:5
|
344 | / pub fn new() -> Self {
345 | | Self {
346 | | initialized: Arc::new(AtomicBool::new(false)),
347 | | svc_info: Service::default(),
... |
352 | | }
353 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
334 + impl Default for ServiceInstancesCacheItem {
335 + fn default() -> Self {
336 + Self::new()
337 + }
338 + }
|
|
you should consider adding a `Default` implementation for `ServicesCacheItem`:
src/core/model/cache.rs#L284
warning: you should consider adding a `Default` implementation for `ServicesCacheItem`
--> src/core/model/cache.rs:284:5
|
284 | / pub fn new() -> Self {
285 | | Self {
286 | | initialized: Arc::new(AtomicBool::new(false)),
287 | | value: Arc::new(RwLock::new(Vec::new())),
288 | | }
289 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
283 + impl Default for ServicesCacheItem {
284 + fn default() -> Self {
285 + Self::new()
286 + }
287 + }
|
|
calling `push_str()` using a single-character string literal:
src/core/model/cache.rs#L235
warning: calling `push_str()` using a single-character string literal
--> src/core/model/cache.rs:235:17
|
235 | key.push_str("#");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `key.push('#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
calling `push_str()` using a single-character string literal:
src/core/model/cache.rs#L230
warning: calling `push_str()` using a single-character string literal
--> src/core/model/cache.rs:230:9
|
230 | key.push_str("#");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `key.push('#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
calling `push_str()` using a single-character string literal:
src/core/model/cache.rs#L228
warning: calling `push_str()` using a single-character string literal
--> src/core/model/cache.rs:228:9
|
228 | key.push_str("#");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `key.push('#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
direct implementation of `ToString`:
src/core/model/cache.rs#L224
warning: direct implementation of `ToString`
--> src/core/model/cache.rs:224:1
|
224 | / impl ToString for ResourceEventKey {
225 | | fn to_string(&self) -> String {
226 | | let mut key = String::new();
227 | | key.push_str(&self.event_type.to_string());
... |
249 | | }
250 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
|
using `clone` on type `Option<&String>` which implements the `Copy` trait:
src/core/model/cache.rs#L215
warning: using `clone` on type `Option<&String>` which implements the `Copy` trait
--> src/core/model/cache.rs:215:21
|
215 | let group = self.filter.get("group").clone().unwrap().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.filter.get("group")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `Option<&String>` which implements the `Copy` trait:
src/core/model/cache.rs#L205
warning: using `clone` on type `Option<&String>` which implements the `Copy` trait
--> src/core/model/cache.rs:205:25
|
205 | let file_name = self.filter.get("file").clone().unwrap().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.filter.get("file")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `Option<&String>` which implements the `Copy` trait:
src/core/model/cache.rs#L204
warning: using `clone` on type `Option<&String>` which implements the `Copy` trait
--> src/core/model/cache.rs:204:21
|
204 | let group = self.filter.get("group").clone().unwrap().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.filter.get("group")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `Option<&String>` which implements the `Copy` trait:
src/core/model/cache.rs#L194
warning: using `clone` on type `Option<&String>` which implements the `Copy` trait
--> src/core/model/cache.rs:194:19
|
194 | let svc = self.filter.get("service").clone().unwrap().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.filter.get("service")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
direct implementation of `ToString`:
src/core/model/cache.rs#L58
warning: direct implementation of `ToString`
--> src/core/model/cache.rs:58:1
|
58 | / impl ToString for EventType {
59 | | fn to_string(&self) -> String {
60 | | match self {
61 | | EventType::Unknown => "unknown".to_string(),
... |
74 | | }
75 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `#[warn(clippy::to_string_trait_impl)]` on by default
|
you are using an explicit closure for cloning elements:
src/core/engine.rs#L360
warning: you are using an explicit closure for cloning elements
--> src/core/engine.rs:360:9
|
360 | lb.get(name).map(|lb| lb.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `lb.get(name).cloned()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
= note: `#[warn(clippy::map_clone)]` on by default
|
unneeded `return` statement:
src/core/engine.rs#L352
warning: unneeded `return` statement
--> src/core/engine.rs:352:9
|
352 | / return match rsp {
353 | | Ok(ret_rsp) => Ok(ret_rsp),
354 | | Err(err) => Err(err),
355 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
352 ~ match rsp {
353 + Ok(ret_rsp) => Ok(ret_rsp),
354 + Err(err) => Err(err),
355 ~ }
|
|
unneeded `return` statement:
src/core/engine.rs#L336
warning: unneeded `return` statement
--> src/core/engine.rs:336:9
|
336 | / return match rsp {
337 | | Ok(ret_rsp) => Ok(ret_rsp),
338 | | Err(err) => Err(err),
339 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
336 ~ match rsp {
337 + Ok(ret_rsp) => Ok(ret_rsp),
338 + Err(err) => Err(err),
339 ~ }
|
|
unneeded `return` statement:
src/core/engine.rs#L320
warning: unneeded `return` statement
--> src/core/engine.rs:320:9
|
320 | / return match rsp {
321 | | Ok(ret_rsp) => Ok(ret_rsp),
322 | | Err(err) => Err(err),
323 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
320 ~ match rsp {
321 + Ok(ret_rsp) => Ok(ret_rsp),
322 + Err(err) => Err(err),
323 ~ }
|
|
unneeded `return` statement:
src/core/engine.rs#L304
warning: unneeded `return` statement
--> src/core/engine.rs:304:9
|
304 | / return match rsp {
305 | | Ok(ret_rsp) => Ok(ret_rsp),
306 | | Err(err) => Err(err),
307 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
304 ~ match rsp {
305 + Ok(ret_rsp) => Ok(ret_rsp),
306 + Err(err) => Err(err),
307 ~ }
|
|
unneeded `return` statement:
src/core/engine.rs#L192
warning: unneeded `return` statement
--> src/core/engine.rs:192:9
|
192 | / return match rsp {
193 | | Ok(_) => Ok(()),
194 | | Err(err) => Err(err),
195 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
192 ~ match rsp {
193 + Ok(_) => Ok(()),
194 + Err(err) => Err(err),
195 ~ }
|
|
unneeded `return` statement:
src/core/engine.rs#L166
warning: unneeded `return` statement
--> src/core/engine.rs:166:9
|
166 | / return match rsp {
167 | | Ok(_) => Ok(()),
168 | | Err(err) => Err(err),
169 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
166 ~ match rsp {
167 + Ok(_) => Ok(()),
168 + Err(err) => Err(err),
169 ~ }
|
|
using `clone` on type `bool` which implements the `Copy` trait:
src/core/engine.rs#L140
warning: using `clone` on type `bool` which implements the `Copy` trait
--> src/core/engine.rs:140:24
|
140 | exist: ins_rsp.exist.clone(),
| ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ins_rsp.exist`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `u32` which implements the `Copy` trait:
src/core/engine.rs#L132
warning: using `clone` on type `u32` which implements the `Copy` trait
--> src/core/engine.rs:132:22
|
132 | ttl: req.ttl.clone(),
| ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `req.ttl`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
unneeded `return` statement:
src/core/engine.rs#L137
warning: unneeded `return` statement
--> src/core/engine.rs:137:9
|
137 | / return match rsp {
138 | | Ok(ins_rsp) => Ok(InstanceRegisterResponse {
139 | | instance_id: ins_rsp.instance.id.clone(),
140 | | exist: ins_rsp.exist.clone(),
141 | | }),
142 | | Err(err) => Err(err),
143 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
137 ~ match rsp {
138 + Ok(ins_rsp) => Ok(InstanceRegisterResponse {
139 + instance_id: ins_rsp.instance.id.clone(),
140 + exist: ins_rsp.exist.clone(),
141 + }),
142 + Err(err) => Err(err),
143 ~ }
|
|
very complex type used. Consider factoring parts into `type` definitions:
src/core/engine.rs#L53
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/core/engine.rs:53:20
|
53 | load_balancer: Arc<RwLock<HashMap<String, Arc<Box<dyn LoadBalancer>>>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
unneeded `return` statement:
src/core/context.rs#L63
warning: unneeded `return` statement
--> src/core/context.rs:63:9
|
63 | / return Ok(Self {
64 | | conf: cfg,
65 | | engine: Arc::new(ret.ok().unwrap()),
66 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
63 ~ Ok(Self {
64 + conf: cfg,
65 + engine: Arc::new(ret.ok().unwrap()),
66 ~ })
|
|
unneeded `return` statement:
src/core/context.rs#L32
warning: unneeded `return` statement
--> src/core/context.rs:32:9
|
32 | / return match cfg_opt {
33 | | Ok(conf) => SDKContext::create_by_configuration(conf),
34 | | Err(err) => Err(PolarisError::new(ErrorCode::InternalError, err.to_string())),
35 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
32 ~ match cfg_opt {
33 + Ok(conf) => SDKContext::create_by_configuration(conf),
34 + Err(err) => Err(PolarisError::new(ErrorCode::InternalError, err.to_string())),
35 ~ }
|
|
method `default` can be confused for the standard trait method `std::default::Default::default`:
src/core/context.rs#L30
warning: method `default` can be confused for the standard trait method `std::default::Default::default`
--> src/core/context.rs:30:5
|
30 | / pub fn default() -> Result<SDKContext, PolarisError> {
31 | | let cfg_opt = load_default();
32 | | return match cfg_opt {
33 | | Ok(conf) => SDKContext::create_by_configuration(conf),
34 | | Err(err) => Err(PolarisError::new(ErrorCode::InternalError, err.to_string())),
35 | | };
36 | | }
| |_____^
|
= help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
calls to `push` immediately after creation:
src/core/config/global.rs#L123
warning: calls to `push` immediately after creation
--> src/core/config/global.rs:123:5
|
123 | / let mut providers = Vec::new();
124 | | providers.push(LocationProviderConfig {
125 | | name: "local".to_string(),
126 | | options: HashMap::new(),
127 | | });
| |_______^ help: consider using the `vec![]` macro: `let providers = vec![..];`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
= note: `#[warn(clippy::vec_init_then_push)]` on by default
|
unneeded `return` statement:
src/core/config/global.rs#L128
warning: unneeded `return` statement
--> src/core/config/global.rs:128:5
|
128 | return providers;
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
128 - return providers;
128 + providers
|
|
unneeded `return` statement:
src/core/config/global.rs#L85
warning: unneeded `return` statement
--> src/core/config/global.rs:85:9
|
85 | return self.protocol.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
85 - return self.protocol.clone();
85 + self.protocol.clone()
|
|
deref which would be done by auto-deref:
src/core/config/config.rs#L52
warning: deref which would be done by auto-deref
--> src/core/config/config.rs:52:34
|
52 | serde_yaml::from_str(&*data).expect(&format!("failure to format yaml str {}", &data));
| ^^^^^^ help: try: `&data`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
= note: `#[warn(clippy::explicit_auto_deref)]` on by default
|
use of `expect` followed by a function call:
src/core/config/config.rs#L52
warning: use of `expect` followed by a function call
--> src/core/config/config.rs:52:42
|
52 | serde_yaml::from_str(&*data).expect(&format!("failure to format yaml str {}", &data));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("failure to format yaml str {}", &data))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
|
unneeded `return` statement:
src/core/config/config.rs#L55
warning: unneeded `return` statement
--> src/core/config/config.rs:55:5
|
55 | return Err(val.err().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
55 - return Err(val.err().unwrap());
55 + Err(val.err().unwrap())
|
|
unneeded `return` statement:
src/core/config/config.rs#L44
warning: unneeded `return` statement
--> src/core/config/config.rs:44:5
|
44 | return load(path);
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
44 - return load(path);
44 + load(path)
|
|
this lifetime isn't used in the function definition:
src/core/config/config.rs#L33
warning: this lifetime isn't used in the function definition
--> src/core/config/config.rs:33:21
|
33 | pub fn load_default<'a>() -> Result<Configuration, io::Error> {
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
= note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
|
module has the same name as its containing module:
src/core/config/mod.rs#L15
warning: module has the same name as its containing module
--> src/core/config/mod.rs:15:1
|
15 | pub mod config;
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
|
redundant closure:
src/config/default.rs#L167
warning: redundant closure
--> src/config/default.rs:167:29
|
167 | .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
= note: `#[warn(clippy::redundant_closure)]` on by default
|
calling `push_str()` using a single-character string literal:
src/config/default.rs#L65
warning: calling `push_str()` using a single-character string literal
--> src/config/default.rs:65:9
|
65 | watch_key.push_str("#");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `watch_key.push('#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
calling `push_str()` using a single-character string literal:
src/config/default.rs#L63
warning: calling `push_str()` using a single-character string literal
--> src/config/default.rs:63:9
|
63 | watch_key.push_str("#");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `watch_key.push('#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
trait `RateLimitAPI` is never used:
src/ratelimit/api.rs#L16
warning: trait `RateLimitAPI` is never used
--> src/ratelimit/api.rs:16:11
|
16 | pub trait RateLimitAPI {}
| ^^^^^^^^^^^^
|
field `opt` is never read:
src/plugins/location/remotehttp/remotehttp.rs#L25
warning: field `opt` is never read
--> src/plugins/location/remotehttp/remotehttp.rs:25:5
|
24 | pub struct RemoteHttpLocationSupplier {
| -------------------------- field in this struct
25 | opt: LocationProviderConfig,
| ^^^
|
methods `encrypt` and `encrypt_to_base64` are never used:
src/plugins/filter/configcrypto/crypto.rs#L247
warning: methods `encrypt` and `encrypt_to_base64` are never used
--> src/plugins/filter/configcrypto/crypto.rs:247:8
|
214 | impl RSACryptor {
| --------------- methods in this implementation
...
247 | fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>, PolarisError> {
| ^^^^^^^
...
272 | fn encrypt_to_base64(&self, plaintext: &[u8]) -> Result<String, PolarisError> {
| ^^^^^^^^^^^^^^^^^
|
method `encrypt` is never used:
src/plugins/filter/configcrypto/crypto.rs#L58
warning: method `encrypt` is never used
--> src/plugins/filter/configcrypto/crypto.rs:58:8
|
53 | trait Cryptor
| ------- method in this trait
...
58 | fn encrypt(&self, plaintext: String, key: String) -> Result<String, PolarisError>;
| ^^^^^^^
|
fields `discover_grpc_client` and `config_grpc_client` are never read:
src/plugins/connector/grpc/connector.rs#L58
warning: fields `discover_grpc_client` and `config_grpc_client` are never read
--> src/plugins/connector/grpc/connector.rs:58:5
|
54 | pub struct GrpcConnector {
| ------------- fields in this struct
...
58 | discover_grpc_client: PolarisGrpcClient<Channel>,
| ^^^^^^^^^^^^^^^^^^^^
59 | config_grpc_client: PolarisConfigGrpcClient<Channel>,
| ^^^^^^^^^^^^^^^^^^
|
= note: `GrpcConnector` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
associated function `new` is never used:
src/discovery/default.rs#L357
warning: associated function `new` is never used
--> src/discovery/default.rs:357:12
|
356 | impl DefaultLosslessAPI {
| ----------------------- associated function in this implementation
357 | pub fn new(context: SDKContext) -> Self {
| ^^^
|
struct `DefaultLosslessAPI` is never constructed:
src/discovery/default.rs#L352
warning: struct `DefaultLosslessAPI` is never constructed
--> src/discovery/default.rs:352:12
|
352 | pub struct DefaultLosslessAPI {
| ^^^^^^^^^^^^^^^^^^
|
trait `LosslessAPI` is never used:
src/discovery/api.rs#L143
warning: trait `LosslessAPI` is never used
--> src/discovery/api.rs:143:18
|
143 | pub(crate) trait LosslessAPI {
| ^^^^^^^^^^^
|
function `new_lossless_api_by_context` is never used:
src/discovery/api.rs#L137
warning: function `new_lossless_api_by_context` is never used
--> src/discovery/api.rs:137:15
|
137 | pub(crate) fn new_lossless_api_by_context(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
function `new_lossless_api` is never used:
src/discovery/api.rs#L128
warning: function `new_lossless_api` is never used
--> src/discovery/api.rs:128:15
|
128 | pub(crate) fn new_lossless_api() -> Result<impl LosslessAPI, PolarisError> {
| ^^^^^^^^^^^^^^^^
|
field `routers` is never read:
src/core/plugin/plugins.rs#L193
warning: field `routers` is never read
--> src/core/plugin/plugins.rs:193:5
|
191 | pub struct PluginContainer {
| --------------- field in this struct
192 | connectors: HashMap<String, fn(InitConnectorOption) -> Box<dyn Connector>>,
193 | routers: HashMap<String, fn(&Configuration) -> Box<dyn ServiceRouter>>,
| ^^^^^^^
|
variants `Header`, `Cookie`, `Query`, `Method`, `Path`, and `CallerIp` are never constructed:
src/core/model/router.rs#L28
warning: variants `Header`, `Cookie`, `Query`, `Method`, `Path`, and `CallerIp` are never constructed
--> src/core/model/router.rs:28:5
|
27 | enum TrafficLabel {
| ------------ variants in this enum
28 | Header,
| ^^^^^^
29 | Cookie,
| ^^^^^^
30 | Query,
| ^^^^^
31 | Method,
| ^^^^^^
32 | Path,
| ^^^^
33 | CallerIp,
| ^^^^^^^^
|
variants `MetadataFailoverNone`, `MetadataFailoverAll`, and `MetadataFailoverNoKey` are never constructed:
src/core/model/router.rs#L22
warning: variants `MetadataFailoverNone`, `MetadataFailoverAll`, and `MetadataFailoverNoKey` are never constructed
--> src/core/model/router.rs:22:5
|
21 | enum MetadataFailoverType {
| -------------------- variants in this enum
22 | MetadataFailoverNone,
| ^^^^^^^^^^^^^^^^^^^^
23 | MetadataFailoverAll,
| ^^^^^^^^^^^^^^^^^^^
24 | MetadataFailoverNoKey,
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `MetadataFailoverType` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
|
constant `CONFIG_FILE_TAG_KEY_USE_ENCRYPTED` is never used:
src/core/model/config.rs#L19
warning: constant `CONFIG_FILE_TAG_KEY_USE_ENCRYPTED` is never used
--> src/core/model/config.rs:19:7
|
19 | const CONFIG_FILE_TAG_KEY_USE_ENCRYPTED: &str = "internal-encrypted";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
variants `RetUnknown`, `RetSuccess`, `RetFail`, `RetTimeout`, `RetReject`, and `RetFlowControl` are never constructed:
src/core/model/circuitbreaker.rs#L34
warning: variants `RetUnknown`, `RetSuccess`, `RetFail`, `RetTimeout`, `RetReject`, and `RetFlowControl` are never constructed
--> src/core/model/circuitbreaker.rs:34:5
|
33 | enum RetStatus {
| --------- variants in this enum
34 | RetUnknown,
| ^^^^^^^^^^
35 | RetSuccess,
| ^^^^^^^^^^
36 | RetFail,
| ^^^^^^^
37 | RetTimeout,
| ^^^^^^^^^^
38 | RetReject,
| ^^^^^^^^^
39 | RetFlowControl,
| ^^^^^^^^^^^^^^
|
variants `Close`, `HalfOpen`, `Open`, and `Destroy` are never constructed:
src/core/model/circuitbreaker.rs#L19
warning: variants `Close`, `HalfOpen`, `Open`, and `Destroy` are never constructed
--> src/core/model/circuitbreaker.rs:19:5
|
18 | enum Status {
| ------ variants in this enum
19 | Close,
| ^^^^^
20 | HalfOpen,
| ^^^^^^^^
21 | Open,
| ^^^^
22 | Destroy,
| ^^^^^^^
|
function `default_location_providers` is never used:
src/core/config/global.rs#L122
warning: function `default_location_providers` is never used
--> src/core/config/global.rs:122:4
|
122 | fn default_location_providers() -> Vec<LocationProviderConfig> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
field `manage_sdk` is never read:
src/config/default.rs#L95
warning: field `manage_sdk` is never read
--> src/config/default.rs:95:5
|
93 | pub struct DefaultConfigFileAPI {
| -------------------- field in this struct
94 | context: Arc<SDKContext>,
95 | manage_sdk: bool,
| ^^^^^^^^^^
|
trait `CircuitBreakerAPI` is never used:
src/circuitbreaker/api.rs#L16
warning: trait `CircuitBreakerAPI` is never used
--> src/circuitbreaker/api.rs:16:11
|
16 | pub trait CircuitBreakerAPI {}
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
type `core::model::router::MetadataFailoverType` is more private than the item `core::model::router::CallerInfo::metadata_failover`:
src/core/model/router.rs#L47
warning: type `core::model::router::MetadataFailoverType` is more private than the item `core::model::router::CallerInfo::metadata_failover`
--> src/core/model/router.rs:47:5
|
47 | pub metadata_failover: MetadataFailoverType,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `core::model::router::CallerInfo::metadata_failover` is reachable at visibility `pub`
|
note: but type `core::model::router::MetadataFailoverType` is only usable at visibility `pub(self)`
--> src/core/model/router.rs:21:1
|
21 | enum MetadataFailoverType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
type `core::model::router::TrafficLabel` is more private than the item `core::model::router::Argument::traffic_label`:
src/core/model/router.rs#L37
warning: type `core::model::router::TrafficLabel` is more private than the item `core::model::router::Argument::traffic_label`
--> src/core/model/router.rs:37:5
|
37 | pub traffic_label: TrafficLabel,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `core::model::router::Argument::traffic_label` is reachable at visibility `pub`
|
note: but type `core::model::router::TrafficLabel` is only usable at visibility `pub(self)`
--> src/core/model/router.rs:27:1
|
27 | enum TrafficLabel {
| ^^^^^^^^^^^^^^^^^
|
type `core::model::circuitbreaker::RetStatus` is more private than the item `core::model::circuitbreaker::ResourceStat::status`:
src/core/model/circuitbreaker.rs#L46
warning: type `core::model::circuitbreaker::RetStatus` is more private than the item `core::model::circuitbreaker::ResourceStat::status`
--> src/core/model/circuitbreaker.rs:46:5
|
46 | pub status: RetStatus,
| ^^^^^^^^^^^^^^^^^^^^^ field `core::model::circuitbreaker::ResourceStat::status` is reachable at visibility `pub`
|
note: but type `core::model::circuitbreaker::RetStatus` is only usable at visibility `pub(self)`
--> src/core/model/circuitbreaker.rs:33:1
|
33 | enum RetStatus {
| ^^^^^^^^^^^^^^
|
type `core::model::circuitbreaker::Status` is more private than the item `core::model::circuitbreaker::CircuitBreakerStatus::status`:
src/core/model/circuitbreaker.rs#L27
warning: type `core::model::circuitbreaker::Status` is more private than the item `core::model::circuitbreaker::CircuitBreakerStatus::status`
--> src/core/model/circuitbreaker.rs:27:5
|
27 | pub status: Status,
| ^^^^^^^^^^^^^^^^^^ field `core::model::circuitbreaker::CircuitBreakerStatus::status` is reachable at visibility `pub`
|
note: but type `core::model::circuitbreaker::Status` is only usable at visibility `pub(self)`
--> src/core/model/circuitbreaker.rs:18:1
|
18 | enum Status {
| ^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
|
variable does not need to be mutable:
src/router/default.rs#L51
warning: variable does not need to be mutable
--> src/router/default.rs:51:13
|
51 | let mut criteria = req.criteria.clone();
| ----^^^^^^^^
| |
| help: remove this `mut`
|
variable does not need to be mutable:
src/plugins/location/remotehttp/remotehttp.rs#L103
warning: variable does not need to be mutable
--> src/plugins/location/remotehttp/remotehttp.rs:103:24
|
103 | Ok(mut body) => body,
| ----^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
|
unused variable: `server_switch_interval`:
src/plugins/connector/grpc/connector.rs#L74
warning: unused variable: `server_switch_interval`
--> src/plugins/connector/grpc/connector.rs:74:9
|
74 | let server_switch_interval = conf.server_switch_interval;
| ^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_server_switch_interval`
|
unused variable: `connect_timeout`:
src/plugins/connector/grpc/connector.rs#L73
warning: unused variable: `connect_timeout`
--> src/plugins/connector/grpc/connector.rs:73:9
|
73 | let connect_timeout = conf.connect_timeout;
| ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_connect_timeout`
|
unused variable: `client_id`:
src/plugins/connector/grpc/connector.rs#L71
warning: unused variable: `client_id`
--> src/plugins/connector/grpc/connector.rs:71:9
|
71 | let client_id = opt.client_id.clone();
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_client_id`
|
unused variable: `req`:
src/discovery/default.rs#L344
warning: unused variable: `req`
--> src/discovery/default.rs:344:9
|
344 | req: ReportServiceContractRequest,
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L163
warning: unused variable: `req`
--> src/core/plugin/connector.rs:163:9
|
163 | req: ConfigPublishRequest,
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L157
warning: unused variable: `req`
--> src/core/plugin/connector.rs:157:41
|
157 | async fn release_config_file(&self, req: ConfigReleaseRequest) -> Result<bool, PolarisError> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L153
warning: unused variable: `req`
--> src/core/plugin/connector.rs:153:40
|
153 | async fn update_config_file(&self, req: ConfigFileRequest) -> Result<bool, PolarisError> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L149
warning: unused variable: `req`
--> src/core/plugin/connector.rs:149:40
|
149 | async fn create_config_file(&self, req: ConfigFileRequest) -> Result<bool, PolarisError> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L133
warning: unused variable: `req`
--> src/core/plugin/connector.rs:133:40
|
133 | async fn heartbeat_instance(&self, req: InstanceRequest) -> Result<bool, PolarisError> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L129
warning: unused variable: `req`
--> src/core/plugin/connector.rs:129:41
|
129 | async fn deregister_instance(&self, req: InstanceRequest) -> Result<bool, PolarisError> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/core/plugin/connector.rs#L124
warning: unused variable: `req`
--> src/core/plugin/connector.rs:124:9
|
124 | req: InstanceRequest,
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `handler`:
src/core/plugin/connector.rs#L117
warning: unused variable: `handler`
--> src/core/plugin/connector.rs:117:9
|
117 | handler: Box<dyn ResourceHandler>,
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_handler`
|
unused variable: `listener`:
src/core/plugin/cache.rs#L130
warning: unused variable: `listener`
--> src/core/plugin/cache.rs:130:48
|
130 | async fn register_resource_listener(&self, listener: Arc<dyn ResourceListener>) {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_listener`
|
unused variable: `filter`:
src/core/plugin/cache.rs#L126
warning: unused variable: `filter`
--> src/core/plugin/cache.rs:126:45
|
126 | async fn load_config_group_files(&self, filter: Filter) -> Result<ConfigGroup, PolarisError> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_filter`
|
unused variable: `filter`:
src/core/plugin/cache.rs#L122
warning: unused variable: `filter`
--> src/core/plugin/cache.rs:122:38
|
122 | async fn load_config_file(&self, filter: Filter) -> Result<ConfigFile, PolarisError> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_filter`
|
unused variable: `filter`:
src/core/plugin/cache.rs#L117
warning: unused variable: `filter`
--> src/core/plugin/cache.rs:117:9
|
117 | filter: Filter,
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_filter`
|
unused variable: `filter`:
src/core/plugin/cache.rs#L111
warning: unused variable: `filter`
--> src/core/plugin/cache.rs:111:35
|
111 | async fn load_services(&self, filter: Filter) -> Result<Services, PolarisError> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_filter`
|
unused variable: `filter`:
src/core/plugin/cache.rs#L107
warning: unused variable: `filter`
--> src/core/plugin/cache.rs:107:39
|
107 | async fn load_service_rule(&self, filter: Filter) -> Result<ServiceRule, PolarisError> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_filter`
|
unused variable: `f`:
src/core/model/config.rs#L123
warning: unused variable: `f`
--> src/core/model/config.rs:123:30
|
123 | pub fn convert_from_spec(f: crate::core::model::pb::lib::ClientConfigFileInfo) -> ConfigFile {
| ^ help: if this is intentional, prefix it with an underscore: `_f`
|
unused variable: `req`:
src/config/default.rs#L188
warning: unused variable: `req`
--> src/config/default.rs:188:9
|
188 | req: WatchConfigGroupRequest,
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `req`:
src/config/default.rs#L181
warning: unused variable: `req`
--> src/config/default.rs:181:9
|
181 | req: GetConfigGroupRequest,
| ^^^ help: if this is intentional, prefix it with an underscore: `_req`
|
unused variable: `action`:
src/config/default.rs#L58
warning: unused variable: `action`
--> src/config/default.rs:58:30
|
58 | async fn on_event(&self, action: Action, val: ServerEvent) {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_action`
|
= note: `#[warn(unused_variables)]` on by default
|
redundant field names in struct initialization:
src/plugins/location/remotehttp/remotehttp.rs#L90
warning: redundant field names in struct initialization
--> src/plugins/location/remotehttp/remotehttp.rs:90:13
|
90 | campus: campus,
| ^^^^^^^^^^^^^^ help: replace it with: `campus`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/location/remotehttp/remotehttp.rs#L89
warning: redundant field names in struct initialization
--> src/plugins/location/remotehttp/remotehttp.rs:89:13
|
89 | zone: zone,
| ^^^^^^^^^^ help: replace it with: `zone`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/location/remotehttp/remotehttp.rs#L88
warning: redundant field names in struct initialization
--> src/plugins/location/remotehttp/remotehttp.rs:88:13
|
88 | region: region,
| ^^^^^^^^^^^^^^ help: replace it with: `region`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/location/remotehttp/remotehttp.rs#L51
warning: redundant field names in struct initialization
--> src/plugins/location/remotehttp/remotehttp.rs:51:13
|
51 | opt: opt,
| ^^^^^^^^ help: replace it with: `opt`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `super::*`:
src/plugins/filter/configcrypto/crypto.rs#L350
warning: unused import: `super::*`
--> src/plugins/filter/configcrypto/crypto.rs:350:9
|
350 | use super::*;
| ^^^^^^^^
|
redundant field names in struct initialization:
src/plugins/filter/configcrypto/crypto.rs#L241
warning: redundant field names in struct initialization
--> src/plugins/filter/configcrypto/crypto.rs:241:13
|
241 | priv_key: priv_key,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `priv_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/connector/grpc/connector.rs#L394
warning: redundant field names in struct initialization
--> src/plugins/connector/grpc/connector.rs:394:17
|
394 | handler: handler,
| ^^^^^^^^^^^^^^^^ help: replace it with: `handler`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/connector/grpc/connector.rs#L90
warning: redundant field names in struct initialization
--> src/plugins/connector/grpc/connector.rs:90:9
|
90 | config_grpc_client: config_grpc_client,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `config_grpc_client`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/connector/grpc/connector.rs#L89
warning: redundant field names in struct initialization
--> src/plugins/connector/grpc/connector.rs:89:9
|
89 | discover_grpc_client: discover_grpc_client,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `discover_grpc_client`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/connector/grpc/connector.rs#L86
warning: redundant field names in struct initialization
--> src/plugins/connector/grpc/connector.rs:86:9
|
86 | opt: opt,
| ^^^^^^^^ help: replace it with: `opt`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `self`:
src/plugins/connector/grpc/connector.rs#L35
warning: unused import: `self`
--> src/plugins/connector/grpc/connector.rs:35:17
|
35 | use std::time::{self, Duration};
| ^^^^
|
redundant field names in struct initialization:
src/plugins/cache/memory/memory.rs#L756
warning: redundant field names in struct initialization
--> src/plugins/cache/memory/memory.rs:756:13
|
756 | event_key: event_key,
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `event_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/cache/memory/memory.rs#L693
warning: redundant field names in struct initialization
--> src/plugins/cache/memory/memory.rs:693:13
|
693 | labels: labels,
| ^^^^^^^^^^^^^^ help: replace it with: `labels`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/cache/memory/memory.rs#L443
warning: redundant field names in struct initialization
--> src/plugins/cache/memory/memory.rs:443:21
|
443 | rules: rules,
| ^^^^^^^^^^^^ help: replace it with: `rules`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/cache/memory/memory.rs#L366
warning: redundant field names in struct initialization
--> src/plugins/cache/memory/memory.rs:366:9
|
366 | server_connector: server_connector,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `server_connector`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/cache/memory/memory.rs#L365
warning: redundant field names in struct initialization
--> src/plugins/cache/memory/memory.rs:365:9
|
365 | opt: opt,
| ^^^^^^^^ help: replace it with: `opt`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/plugins/cache/memory/memory.rs#L105
warning: redundant field names in struct initialization
--> src/plugins/cache/memory/memory.rs:105:25
|
105 | event_type: event_type,
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `event_type`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `Extensions`:
src/plugins/cache/memory/memory.rs#L34
warning: unused import: `Extensions`
--> src/plugins/cache/memory/memory.rs:34:36
|
34 | use crate::core::plugin::plugins::{Extensions, Plugin};
| ^^^^^^^^^^
|
unused import: `ServiceInstances`:
src/plugins/cache/memory/memory.rs#L29
warning: unused import: `ServiceInstances`
--> src/plugins/cache/memory/memory.rs:29:44
|
29 | use crate::core::model::naming::{Instance, ServiceInstances, ServiceRule, Services};
| ^^^^^^^^^^^^^^^^
|
unused import: `crate::core::config::global::LocalCacheConfig`:
src/plugins/cache/memory/memory.rs#L20
warning: unused import: `crate::core::config::global::LocalCacheConfig`
--> src/plugins/cache/memory/memory.rs:20:5
|
20 | use crate::core::config::global::LocalCacheConfig;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
redundant field names in struct initialization:
src/discovery/default.rs#L157
warning: redundant field names in struct initialization
--> src/discovery/default.rs:157:25
|
157 | criteria: criteria,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `criteria`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/discovery/req.rs#L182
warning: redundant field names in struct initialization
--> src/discovery/req.rs:182:13
|
182 | vpc_id: vpc_id,
| ^^^^^^^^^^^^^^ help: replace it with: `vpc_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/discovery/req.rs#L181
warning: redundant field names in struct initialization
--> src/discovery/req.rs:181:13
|
181 | port: port,
| ^^^^^^^^^^ help: replace it with: `port`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/discovery/req.rs#L180
warning: redundant field names in struct initialization
--> src/discovery/req.rs:180:13
|
180 | ip: ip,
| ^^^^^^ help: replace it with: `ip`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/discovery/req.rs#L179
warning: redundant field names in struct initialization
--> src/discovery/req.rs:179:13
|
179 | service: service,
| ^^^^^^^^^^^^^^^^ help: replace it with: `service`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/discovery/req.rs#L178
warning: redundant field names in struct initialization
--> src/discovery/req.rs:178:13
|
178 | namespace: namespace,
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `namespace`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `ServiceInfo`:
src/discovery/req.rs#L21
warning: unused import: `ServiceInfo`
--> src/discovery/req.rs:21:25
|
21 | Instance, Location, ServiceInfo, ServiceInstances, ServiceInstancesChangeEvent,
| ^^^^^^^^^^^
|
redundant field names in struct initialization:
src/core/plugin/plugins.rs#L106
warning: redundant field names in struct initialization
--> src/core/plugin/plugins.rs:106:13
|
106 | conf: conf,
| ^^^^^^^^^^ help: replace it with: `conf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/plugin/plugins.rs#L105
warning: redundant field names in struct initialization
--> src/core/plugin/plugins.rs:105:13
|
105 | client_id: client_id,
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `client_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `ServiceInstances`:
src/core/plugin/cache.rs#L22
warning: unused import: `ServiceInstances`
--> src/core/plugin/cache.rs:22:34
|
22 | use crate::core::model::naming::{ServiceInstances, ServiceRule, Services};
| ^^^^^^^^^^^^^^^^
|
redundant field names in struct initialization:
src/core/model/naming.rs#L259
warning: redundant field names in struct initialization
--> src/core/model/naming.rs:259:13
|
259 | health_check: health_check,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `health_check`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/model/naming.rs#L258
warning: redundant field names in struct initialization
--> src/core/model/naming.rs:258:13
|
258 | enable_health_check: enable_health_check,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `enable_health_check`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/model/naming.rs#L138
warning: redundant field names in struct initialization
--> src/core/model/naming.rs:138:13
|
138 | metadata: metadata,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `metadata`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/model/config.rs#L50
warning: redundant field names in struct initialization
--> src/core/model/config.rs:50:13
|
50 | tags: tags,
| ^^^^^^^^^^ help: replace it with: `tags`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unneeded unit return type:
src/core/model/cache.rs#L820
warning: unneeded unit return type
--> src/core/model/cache.rs:820:71
|
820 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
redundant field names in struct initialization:
src/core/model/cache.rs#L784
warning: redundant field names in struct initialization
--> src/core/model/cache.rs:784:13
|
784 | labels: labels,
| ^^^^^^^^^^^^^^ help: replace it with: `labels`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unneeded unit return type:
src/core/model/cache.rs#L743
warning: unneeded unit return type
--> src/core/model/cache.rs:743:71
|
743 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L678
warning: unneeded unit return type
--> src/core/model/cache.rs:678:71
|
678 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L619
warning: unneeded unit return type
--> src/core/model/cache.rs:619:71
|
619 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L560
warning: unneeded unit return type
--> src/core/model/cache.rs:560:71
|
560 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L501
warning: unneeded unit return type
--> src/core/model/cache.rs:501:71
|
501 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L461
warning: unneeded unit return type
--> src/core/model/cache.rs:461:71
|
461 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L402
warning: unneeded unit return type
--> src/core/model/cache.rs:402:71
|
402 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L311
warning: unneeded unit return type
--> src/core/model/cache.rs:311:71
|
311 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L270
warning: unneeded unit return type
--> src/core/model/cache.rs:270:71
|
270 | async fn wait_initialize(&self, timeout: Duration) -> Box<dyn Fn() -> () + Send>;
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
|
unneeded unit return type:
src/core/model/cache.rs#L252
warning: unneeded unit return type
--> src/core/model/cache.rs:252:81
|
252 | fn build_waiter(initialized: Arc<AtomicBool>, timeout: Duration) -> Box<dyn Fn() -> () + Send> {
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
= note: `#[warn(clippy::unused_unit)]` on by default
|
redundant field names in struct initialization:
src/core/model/cache.rs#L187
warning: redundant field names in struct initialization
--> src/core/model/cache.rs:187:17
|
187 | revision: revision,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `revision`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/model/cache.rs#L182
warning: redundant field names in struct initialization
--> src/core/model/cache.rs:182:17
|
182 | revision: revision,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `revision`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `self`:
src/core/model/cache.rs#L20
warning: unused import: `self`
--> src/core/model/cache.rs:20:12
|
20 | time::{self, Duration},
| ^^^^
|
redundant field names in struct initialization:
src/core/engine.rs#L213
warning: redundant field names in struct initialization
--> src/core/engine.rs:213:21
|
213 | filter: filter,
| ^^^^^^^^^^^^^^ help: replace it with: `filter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/engine.rs#L133
warning: redundant field names in struct initialization
--> src/core/engine.rs:133:17
|
133 | instance: instance,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `instance`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/core/engine.rs#L105
warning: redundant field names in struct initialization
--> src/core/engine.rs:105:13
|
105 | server_connector: server_connector,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `server_connector`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused imports: `CONFIG_SERVER_CONNECTOR` and `DISCOVER_SERVER_CONNECTOR`:
src/core/context.rs#L19
warning: unused imports: `CONFIG_SERVER_CONNECTOR` and `DISCOVER_SERVER_CONNECTOR`
--> src/core/context.rs:19:35
|
19 | use crate::core::config::global::{CONFIG_SERVER_CONNECTOR, DISCOVER_SERVER_CONNECTOR};
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
|
unused import: `super::global::PluginConfig`:
src/core/config/consumer.rs#L20
warning: unused import: `super::global::PluginConfig`
--> src/core/config/consumer.rs:20:5
|
20 | use super::global::PluginConfig;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
redundant field names in struct initialization:
src/config/default.rs#L106
warning: redundant field names in struct initialization
--> src/config/default.rs:106:13
|
106 | manage_sdk: manage_sdk,
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `manage_sdk`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unused import: `self`:
src/config/default.rs#L39
warning: unused import: `self`
--> src/config/default.rs:39:9
|
39 | self, CreateConfigFileRequest, GetConfigFileRequest, GetConfigGroupRequest,
| ^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
redundant field names in struct initialization:
src/config/req.rs#L107
warning: redundant field names in struct initialization
--> src/config/req.rs:107:13
|
107 | flow_id: flow_id,
| ^^^^^^^^^^^^^^^^ help: replace it with: `flow_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/config/req.rs#L85
warning: redundant field names in struct initialization
--> src/config/req.rs:85:13
|
85 | flow_id: flow_id,
| ^^^^^^^^^^^^^^^^ help: replace it with: `flow_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/config/req.rs#L65
warning: redundant field names in struct initialization
--> src/config/req.rs:65:13
|
65 | flow_id: flow_id,
| ^^^^^^^^^^^^^^^^ help: replace it with: `flow_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/config/req.rs#L45
warning: redundant field names in struct initialization
--> src/config/req.rs:45:13
|
45 | flow_id: flow_id,
| ^^^^^^^^^^^^^^^^ help: replace it with: `flow_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
Clippy check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Clippy check
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/cache@v3, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Run tests
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Run tests
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/cache@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Run tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Run tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Run tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Run tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Run tests:
src/config/default.rs#L39
unused import: `self`
|
Run tests:
src/core/config/consumer.rs#L20
unused import: `super::global::PluginConfig`
|
Run tests:
src/core/context.rs#L19
unused imports: `CONFIG_SERVER_CONNECTOR` and `DISCOVER_SERVER_CONNECTOR`
|
Run tests:
src/core/model/cache.rs#L20
unused import: `self`
|
Run tests:
src/core/plugin/cache.rs#L22
unused import: `ServiceInstances`
|
Run tests:
src/discovery/req.rs#L21
unused import: `ServiceInfo`
|
Run tests:
src/plugins/cache/memory/memory.rs#L20
unused import: `crate::core::config::global::LocalCacheConfig`
|
Run tests:
src/plugins/cache/memory/memory.rs#L29
unused import: `ServiceInstances`
|
Run tests:
src/plugins/cache/memory/memory.rs#L34
unused import: `Extensions`
|
Run tests:
src/plugins/connector/grpc/connector.rs#L35
unused import: `self`
|