Skip to content

feat:支持负载均衡 #1

feat:支持负载均衡

feat:支持负载均衡 #1

Triggered via push October 23, 2024 14:11
Status Failure
Total duration 2m 38s
Artifacts

check.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

3 errors and 293 warnings
this comparison involving the minimum or maximum element for this type contains a case that is always true or always false: src/plugins/connector/grpc/manager.rs#L366
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false --> src/plugins/connector/grpc/manager.rs:366:26 | 366 | let need_close = self.ref_cnt.load(SeqCst) <= 0 && !self.closed.load(SeqCst); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: because `0` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `self.ref_cnt.load(SeqCst) == 0` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
this comparison involving the minimum or maximum element for this type contains a case that is always true or always false: src/plugins/connector/grpc/manager.rs#L359
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false --> src/plugins/connector/grpc/manager.rs:359:12 | 359 | if cur_ref <= 0 { | ^^^^^^^^^^^^ | = help: because `0` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `cur_ref == 0` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons = note: `#[deny(clippy::absurd_extreme_comparisons)]` on by default
Clippy check
Clippy had exited with the 101 exit code
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() { | ~ ~~~~~~~~~~~~~~~~~~~
returning the result of a `let` binding from a block: src/plugins/connector/grpc/manager.rs#L465
warning: returning the result of a `let` binding from a block --> src/plugins/connector/grpc/manager.rs:465:9 | 464 | let addr = self.endpoint.format_address(); | ------------------------------------------ unnecessary `let` binding 465 | addr | ^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return help: return the expression directly | 464 ~ 465 ~ self.endpoint.format_address() |
unneeded `return` statement: src/plugins/connector/grpc/manager.rs#L411
warning: unneeded `return` statement --> src/plugins/connector/grpc/manager.rs:411:9 | 411 | return true; | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 411 - return true; 411 + true |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/plugins/connector/grpc/manager.rs#L373
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/plugins/connector/grpc/manager.rs:373:9 | 373 | / match self.sender.as_ref() { 374 | | Some(sender) => { 375 | | futures::executor::block_on(async { 376 | | let ret = sender ... | 390 | | None => {} 391 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 373 ~ if let Some(sender) = self.sender.as_ref() { 374 + futures::executor::block_on(async { 375 + let ret = sender 376 + .send(Change::Remove(self.conn_id.format_address())) 377 + .await; 378 + match ret { 379 + Ok(_) => {} 380 + Err(err) => { 381 + error!( 382 + "notify tonic insert polaris-server node address fail: {}", 383 + err 384 + ) 385 + } 386 + } 387 + }); 388 + } |
using `clone` on type `ClusterType` which implements the `Copy` trait: src/plugins/connector/grpc/manager.rs#L268
warning: using `clone` on type `ClusterType` which implements the `Copy` trait --> src/plugins/connector/grpc/manager.rs:268:28 | 268 | .with_cluster_type(conn_mgr.cluster.clone()) | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `conn_mgr.cluster` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/plugins/connector/grpc/manager.rs#L257
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/plugins/connector/grpc/manager.rs:257:5 | 257 | / match conn_mgr.service_info.as_ref() { 258 | | Some(svc_info) => { 259 | | ns = svc_info.namespace.clone().unwrap(); 260 | | svc = svc_info.service.clone().unwrap(); 261 | | } 262 | | None => {} 263 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 257 ~ if let Some(svc_info) = conn_mgr.service_info.as_ref() { 258 + ns = svc_info.namespace.clone().unwrap(); 259 + svc = svc_info.service.clone().unwrap(); 260 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/plugins/connector/grpc/manager.rs#L233
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/plugins/connector/grpc/manager.rs:233:17 | 233 | / match cur_conn { 234 | | Some(conn) => conn.lazy_destroy(), 235 | | None => {} 236 | | } | |_________________^ help: try: `if let Some(conn) = cur_conn { conn.lazy_destroy() }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/plugins/connector/grpc/manager.rs#L207
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/plugins/connector/grpc/manager.rs:207:9 | 207 | / match cur_conn_opt { 208 | | Some(cur_conn) => { 209 | | if !cur_conn.conn_id.eq(last_conn_id) { 210 | | return; ... | 214 | | None => {} 215 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match = note: `#[warn(clippy::single_match)]` on by default help: try | 207 ~ if let Some(cur_conn) = cur_conn_opt { 208 + if !cur_conn.conn_id.eq(last_conn_id) { 209 + return; 210 + } 211 + self.do_switch_client(Some(&cur_conn)) 212 + } |
unneeded `return` statement: src/plugins/connector/grpc/manager.rs#L191
warning: unneeded `return` statement --> src/plugins/connector/grpc/manager.rs:191:9 | 191 | return Ok(self.active_conn.clone()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 191 - return Ok(self.active_conn.clone()); 191 + Ok(self.active_conn.clone()) |
unneeded `return` statement: src/plugins/connector/grpc/connector.rs#L766
warning: unneeded `return` statement --> src/plugins/connector/grpc/connector.rs:766:9 | 766 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 766 - return Ok(()); 766 + Ok(()) |
unneeded `return` statement: src/plugins/connector/grpc/connector.rs#L708
warning: unneeded `return` statement --> src/plugins/connector/grpc/connector.rs:708:9 | 708 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 708 - return Ok(()); 708 + Ok(()) |
you seem to use `.enumerate()` and immediately discard the index: src/plugins/connector/grpc/connector.rs#L360
warning: you seem to use `.enumerate()` and immediately discard the index --> src/plugins/connector/grpc/connector.rs:360:29 | 360 | 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 | 360 | for filter in filters.iter() { | ~~~~~~ ~~~~~~~~~~~~~~
you seem to use `.enumerate()` and immediately discard the index: src/plugins/connector/grpc/connector.rs#L328
warning: you seem to use `.enumerate()` and immediately discard the index --> src/plugins/connector/grpc/connector.rs:328:29 | 328 | 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 | 328 | for filter in filters.iter() { | ~~~~~~ ~~~~~~~~~~~~~~
unneeded `return` statement: src/plugins/connector/grpc/connector.rs#L224
warning: unneeded `return` statement --> src/plugins/connector/grpc/connector.rs:224:9 | 224 | 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` | 224 - return (new_connector, "grpc".to_string()); 224 + (new_connector, "grpc".to_string()) |
very complex type used. Consider factoring parts into `type` definitions: src/plugins/connector/grpc/connector.rs#L223
warning: very complex type used. Consider factoring parts into `type` definitions --> src/plugins/connector/grpc/connector.rs:223:25 | 223 | 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#L195
warning: using `clone` on type `Duration` which implements the `Copy` trait --> src/plugins/connector/grpc/connector.rs:195:30 | 195 | .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#L190
warning: using `clone` on type `Duration` which implements the `Copy` trait --> src/plugins/connector/grpc/connector.rs:190:30 | 190 | .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#L174
warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/plugins/connector/grpc/connector.rs:174:52 | 174 | 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#L169
warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/plugins/connector/grpc/connector.rs:169:54 | 169 | 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#L147
warning: called `unwrap` on `discover_request` after checking its variant with `is_some` --> src/plugins/connector/grpc/connector.rs:147:61 | 146 | if discover_request.is_some() { | ----------------------------- help: try: `if let Some(..) = discover_request` 147 | 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#L90
warning: this `impl` can be derived --> src/core/plugin/connector.rs:90:1 | 90 | / impl Default for NoopConnector { 91 | | fn default() -> Self { 92 | | Self {} 93 | | } 94 | | } | |_^ | = 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 | 88 + #[derive(Default)] 89 | 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#L91
warning: you seem to use `.enumerate()` and immediately discard the index --> src/core/model/config.rs:91:24 | 91 | 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 | 91 | for v in self.tags.iter() { | ~ ~~~~~~~~~~~~~~~~
unneeded `return` statement: src/core/model/config.rs#L97
warning: unneeded `return` statement --> src/core/model/config.rs:97:9 | 97 | return "".to_string(); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 97 - return "".to_string(); 97 + "".to_string() |
you seem to use `.enumerate()` and immediately discard the index: src/core/model/config.rs#L81
warning: you seem to use `.enumerate()` and immediately discard the index --> src/core/model/config.rs:81:24 | 81 | 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 | 81 | for v in self.tags.iter() { | ~ ~~~~~~~~~~~~~~~~
unneeded `return` statement: src/core/model/config.rs#L87
warning: unneeded `return` statement --> src/core/model/config.rs:87:9 | 87 | return "".to_string(); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 87 - return "".to_string(); 87 + "".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#L344
warning: you are using an explicit closure for cloning elements --> src/core/engine.rs:344:9 | 344 | 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#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#L156
warning: redundant closure --> src/config/default.rs:156:29 | 156 | .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#L64
warning: calling `push_str()` using a single-character string literal --> src/config/default.rs:64:9 | 64 | 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#L62
warning: calling `push_str()` using a single-character string literal --> src/config/default.rs:62:9 | 62 | 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>; | ^^^^^^^
multiple associated items are never used: src/plugins/connector/grpc/manager.rs#L430
warning: multiple associated items are never used --> src/plugins/connector/grpc/manager.rs:430:8 | 429 | impl ConnID { | ----------- associated items in this implementation 430 | fn default() -> Self { | ^^^^^^^ ... 439 | fn with_id(mut self, id: String) -> Self { | ^^^^^^^ ... 444 | fn with_svc_key(mut self, svc_key: ServiceKey) -> Self { | ^^^^^^^^^^^^ ... 449 | fn with_cluster_type(mut self, cluster_type: ClusterType) -> Self { | ^^^^^^^^^^^^^^^^^ ... 454 | fn with_ip_port(mut self, endpoint: crate::core::model::naming::Endpoint) -> Self { | ^^^^^^^^^^^^ ... 459 | fn build(mut self) -> Self { | ^^^^^ ... 463 | fn format_address(&self) -> String { | ^^^^^^^^^^^^^^
associated items `empty_conn`, `new`, `lazy_destroy`, `close_connection`, `is_lazy_destroy`, and `acquire` are never used: src/plugins/connector/grpc/manager.rs#L320
warning: associated items `empty_conn`, `new`, `lazy_destroy`, `close_connection`, `is_lazy_destroy`, and `acquire` are never used --> src/plugins/connector/grpc/manager.rs:320:8 | 319 | impl Connection { | --------------- associated items in this implementation 320 | fn empty_conn(conn_mgr: Arc<ConnectionManager>) -> Connection { | ^^^^^^^^^^ ... 334 | fn new( | ^^^ ... 352 | fn lazy_destroy(&self) { | ^^^^^^^^^^^^ ... 364 | fn close_connection(&self) { | ^^^^^^^^^^^^^^^^ ... 394 | fn is_lazy_destroy(&self) -> bool { | ^^^^^^^^^^^^^^^ ... 398 | fn acquire(&self, op: &str) -> bool { | ^^^^^^^
function `available_cur_connection` is never used: src/plugins/connector/grpc/manager.rs#L312
warning: function `available_cur_connection` is never used --> src/plugins/connector/grpc/manager.rs:312:4 | 312 | fn available_cur_connection(conn: Option<&Connection>) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^
multiple fields are never read: src/plugins/connector/grpc/manager.rs#L301
warning: multiple fields are never read --> src/plugins/connector/grpc/manager.rs:301:5 | 300 | pub struct Connection { | ---------- fields in this struct 301 | is_empty: bool, | ^^^^^^^^ 302 | lock: Mutex<u32>, | ^^^^ 303 | sender: Option<Sender<Change<String, Endpoint>>>, | ^^^^^^ 304 | conn_id: ConnID, | ^^^^^^^ 305 | conn_mgr: Arc<ConnectionManager>, | ^^^^^^^^ 306 | create_time: SystemTime, | ^^^^^^^^^^^ 307 | ref_cnt: AtomicU32, | ^^^^^^^ 308 | lazy_destroy: AtomicBool, | ^^^^^^^^^^^^ 309 | closed: AtomicBool, | ^^^^^^
function `notify_change` is never used: src/plugins/connector/grpc/manager.rs#L250
warning: function `notify_change` is never used --> src/plugins/connector/grpc/manager.rs:250:8 | 250 | pub fn notify_change( | ^^^^^^^^^^^^^
multiple associated items are never used: src/plugins/connector/grpc/manager.rs#L152
warning: multiple associated items are never used --> src/plugins/connector/grpc/manager.rs:152:8 | 151 | impl ServerAddress { | ------------------ associated items in this implementation 152 | fn new( | ^^^ ... 170 | fn with_endpoints(mut self, endpoints: Vec<crate::core::model::naming::Endpoint>) -> Self { | ^^^^^^^^^^^^^^ ... 175 | fn with_service_info(mut self, service_info: Option<ServerServiceInfo>) -> Self { | ^^^^^^^^^^^^^^^^^ ... 180 | fn with_connect_timeout(mut self, connect_timeout: Duration) -> Self { | ^^^^^^^^^^^^^^^^^^^^ ... 185 | fn run(&mut self) {} | ^^^ 186 | 187 | fn try_get_connection(&self, op_key: &str) -> Result<Arc<Connection>, PolarisError> { | ^^^^^^^^^^^^^^^^^^ ... 194 | fn get_server_address(&self) -> Result<crate::core::model::naming::Endpoint, PolarisError> { | ^^^^^^^^^^^^^^^^^^ ... 205 | fn switch_client_on_fail(&mut self, cur_conn_opt: Option<Connection>, last_conn_id: &ConnID) { | ^^^^^^^^^^^^^^^^^^^^^ ... 218 | fn switch_client(&mut self, cur_conn_opt: Option<&Connection>) { | ^^^^^^^^^^^^^ ... 229 | fn do_switch_client(&mut self, cur_conn: Option<&Connection>) { | ^^^^^^^^^^^^^^^^ ... 245 | fn discover_instances() -> Result<Instance, PolarisError> { | ^^^^^^^^^^^^^^^^^^
multiple fields are never read: src/plugins/connector/grpc/manager.rs#L137
warning: multiple fields are never read --> src/plugins/connector/grpc/manager.rs:137:5 | 136 | pub struct ServerAddress { | ------------- fields in this struct 137 | lock: Mutex<u32>, | ^^^^ 138 | cluster: ClusterType, | ^^^^^^^ 139 | cur_index: AtomicUsize, | ^^^^^^^^^ 140 | active_conn: Arc<Connection>, | ^^^^^^^^^^^ 141 | ready: AtomicBool, | ^^^^^ 142 | service_info: Option<ServerServiceInfo>, | ^^^^^^^^^^^^ 143 | conn_mgr: Arc<ConnectionManager>, | ^^^^^^^^ 144 | // connect_timeout 连接超时时间 145 | connect_timeout: Duration, | ^^^^^^^^^^^^^^^ 146 | endpoints: Vec<crate::core::model::naming::Endpoint>, | ^^^^^^^^^ 147 | // sender 负责通知底层 gRPC 连接 IP 切换 148 | sender: Sender<Change<String, Endpoint>>, | ^^^^^^
associated items `empty`, `set_on_switch`, `get_connection`, and `try_get_connection` are never used: src/plugins/connector/grpc/manager.rs#L67
warning: associated items `empty`, `set_on_switch`, `get_connection`, and `try_get_connection` are never used --> src/plugins/connector/grpc/manager.rs:67:12 | 66 | impl ConnectionManager { | ---------------------- associated items in this implementation 67 | pub fn empty() -> Self { | ^^^^^ ... 93 | pub fn set_on_switch(&mut self, on_switch: Arc<dyn ConnectionSwitchListener>) { | ^^^^^^^^^^^^^ ... 97 | pub fn get_connection( | ^^^^^^^^^^^^^^ ... 117 | fn try_get_connection( | ^^^^^^^^^^^^^^^^^^
fields `connect_timeout`, `switch_interval`, `client_id`, `server_address`, and `on_switch` are never read: src/plugins/connector/grpc/manager.rs#L59
warning: fields `connect_timeout`, `switch_interval`, `client_id`, `server_address`, and `on_switch` are never read --> src/plugins/connector/grpc/manager.rs:59:9 | 55 | pub struct ConnectionManager | ----------------- fields in this struct ... 59 | pub connect_timeout: Duration, | ^^^^^^^^^^^^^^^ 60 | pub switch_interval: Duration, | ^^^^^^^^^^^^^^^ 61 | pub client_id: String, | ^^^^^^^^^ 62 | pub server_address: HashMap<String, ServerAddress>, | ^^^^^^^^^^^^^^ 63 | pub on_switch: Arc<dyn ConnectionSwitchListener>, | ^^^^^^^^^
method `on_switch` is never used: src/plugins/connector/grpc/manager.rs#L38
warning: method `on_switch` is never used --> src/plugins/connector/grpc/manager.rs:38:8 | 34 | pub trait ConnectionSwitchListener | ------------------------ method in this trait ... 38 | fn on_switch(&self, id: ConnID); | ^^^^^^^^^
fields `connection_manager`, `discover_grpc_client`, and `config_grpc_client` are never read: src/plugins/connector/grpc/connector.rs#L61
warning: fields `connection_manager`, `discover_grpc_client`, and `config_grpc_client` are never read --> src/plugins/connector/grpc/connector.rs:61:5 | 57 | pub struct GrpcConnector { | ------------- fields in this struct ... 61 | connection_manager: Arc<ConnectionManager>, | ^^^^^^^^^^^^^^^^^^ 62 | discover_grpc_client: PolarisGrpcClient<Channel>, | ^^^^^^^^^^^^^^^^^^^^ 63 | 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#L21
warning: constant `CONFIG_FILE_TAG_KEY_USE_ENCRYPTED` is never used --> src/core/model/config.rs:21:7 | 21 | 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#L94
warning: field `manage_sdk` is never read --> src/config/default.rs:94:5 | 92 | pub struct DefaultConfigFileAPI { | -------------------- field in this struct 93 | context: Arc<SDKContext>, 94 | 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 `plugins::connector::grpc::manager::ConnID` is more private than the item `<plugins::connector::grpc::manager::EmptyConnectionSwitchListener as plugins::connector::grpc::manager::ConnectionSwitchListener>::on_switch`: src/plugins/connector/grpc/manager.rs#L50
warning: type `plugins::connector::grpc::manager::ConnID` is more private than the item `<plugins::connector::grpc::manager::EmptyConnectionSwitchListener as plugins::connector::grpc::manager::ConnectionSwitchListener>::on_switch` --> src/plugins/connector/grpc/manager.rs:50:5 | 50 | fn on_switch(&self, id: ConnID) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method `<plugins::connector::grpc::manager::EmptyConnectionSwitchListener as plugins::connector::grpc::manager::ConnectionSwitchListener>::on_switch` is reachable at visibility `pub(grpc)` | note: but type `plugins::connector::grpc::manager::ConnID` is only usable at visibility `pub(self)` --> src/plugins/connector/grpc/manager.rs:416:1 | 416 | pub(self) struct ConnID { | ^^^^^^^^^^^^^^^^^^^^^^^
type `plugins::connector::grpc::manager::ConnID` is more private than the item `plugins::connector::grpc::manager::ConnectionSwitchListener::on_switch`: src/plugins/connector/grpc/manager.rs#L38
warning: type `plugins::connector::grpc::manager::ConnID` is more private than the item `plugins::connector::grpc::manager::ConnectionSwitchListener::on_switch` --> src/plugins/connector/grpc/manager.rs:38:5 | 38 | fn on_switch(&self, id: ConnID); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method `plugins::connector::grpc::manager::ConnectionSwitchListener::on_switch` is reachable at visibility `pub(grpc)` | note: but type `plugins::connector::grpc::manager::ConnID` is only usable at visibility `pub(self)` --> src/plugins/connector/grpc/manager.rs:416:1 | 416 | pub(self) struct ConnID { | ^^^^^^^^^^^^^^^^^^^^^^^
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`
variable does not need to be mutable: src/plugins/connector/grpc/manager.rs#L459
warning: variable does not need to be mutable --> src/plugins/connector/grpc/manager.rs:459:14 | 459 | fn build(mut self) -> Self { | ----^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
unused variable: `op_key`: src/plugins/connector/grpc/manager.rs#L187
warning: unused variable: `op_key` --> src/plugins/connector/grpc/manager.rs:187:34 | 187 | fn try_get_connection(&self, op_key: &str) -> Result<Arc<Connection>, PolarisError> { | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_op_key`
unused variable: `id`: src/plugins/connector/grpc/manager.rs#L50
warning: unused variable: `id` --> src/plugins/connector/grpc/manager.rs:50:25 | 50 | fn on_switch(&self, id: ConnID) { | ^^ help: if this is intentional, prefix it with an underscore: `_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#L154
warning: unused variable: `req` --> src/core/plugin/connector.rs:154:41 | 154 | 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#L150
warning: unused variable: `req` --> src/core/plugin/connector.rs:150:40 | 150 | 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#L146
warning: unused variable: `req` --> src/core/plugin/connector.rs:146:40 | 146 | 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#L130
warning: unused variable: `req` --> src/core/plugin/connector.rs:130:40 | 130 | 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#L126
warning: unused variable: `req` --> src/core/plugin/connector.rs:126:41 | 126 | 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#L121
warning: unused variable: `req` --> src/core/plugin/connector.rs:121:9 | 121 | req: InstanceRequest, | ^^^ help: if this is intentional, prefix it with an underscore: `_req`
unused variable: `handler`: src/core/plugin/connector.rs#L114
warning: unused variable: `handler` --> src/core/plugin/connector.rs:114:9 | 114 | 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#L63
warning: unused variable: `f` --> src/core/model/config.rs:63:30 | 63 | 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#L177
warning: unused variable: `req` --> src/config/default.rs:177:9 | 177 | req: WatchConfigGroupRequest, | ^^^ help: if this is intentional, prefix it with an underscore: `_req`
unused variable: `req`: src/config/default.rs#L170
warning: unused variable: `req` --> src/config/default.rs:170:9 | 170 | req: GetConfigGroupRequest, | ^^^ help: if this is intentional, prefix it with an underscore: `_req`
unused variable: `action`: src/config/default.rs#L57
warning: unused variable: `action` --> src/config/default.rs:57:30 | 57 | 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
unnecessary `pub(self)`: src/plugins/connector/grpc/manager.rs#L416
warning: unnecessary `pub(self)` --> src/plugins/connector/grpc/manager.rs:416:1 | 416 | pub(self) struct ConnID { | ^^^^^^^^^ help: remove it | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pub_self = note: `#[warn(clippy::needless_pub_self)]` on by default
redundant field names in struct initialization: src/plugins/connector/grpc/manager.rs#L326
warning: redundant field names in struct initialization --> src/plugins/connector/grpc/manager.rs:326:13 | 326 | conn_mgr: conn_mgr, | ^^^^^^^^^^^^^^^^^^ help: replace it with: `conn_mgr` | = 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/manager.rs#L164
warning: redundant field names in struct initialization --> src/plugins/connector/grpc/manager.rs:164:13 | 164 | conn_mgr: conn_mgr, | ^^^^^^^^^^^^^^^^^^ help: replace it with: `conn_mgr` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
unused import: `Channel`: src/plugins/connector/grpc/manager.rs#L29
warning: unused import: `Channel` --> src/plugins/connector/grpc/manager.rs:29:24 | 29 | use tonic::transport::{Channel, Endpoint}; | ^^^^^^^
redundant field names in struct initialization: src/plugins/connector/grpc/connector.rs#L404
warning: redundant field names in struct initialization --> src/plugins/connector/grpc/connector.rs:404:17 | 404 | 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#L100
warning: redundant field names in struct initialization --> src/plugins/connector/grpc/connector.rs:100:9 | 100 | 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#L99
warning: redundant field names in struct initialization --> src/plugins/connector/grpc/connector.rs:99:9 | 99 | 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#L90
warning: redundant field names in struct initialization --> src/plugins/connector/grpc/connector.rs:90:9 | 90 | 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#L36
warning: unused import: `self` --> src/plugins/connector/grpc/connector.rs:36:17 | 36 | 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
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#L105
warning: redundant field names in struct initialization --> src/config/default.rs:105:13 | 105 | 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, | ^^^^
unused import: `DeleteConfigFileRequest`: src/config/api.rs#L27
warning: unused import: `DeleteConfigFileRequest` --> src/config/api.rs:27:30 | 27 | CreateConfigFileRequest, DeleteConfigFileRequest, GetConfigFileRequest, GetConfigGroupRequest, | ^^^^^^^^^^^^^^^^^^^^^^^
redundant field names in struct initialization: src/config/req.rs#L116
warning: redundant field names in struct initialization --> src/config/req.rs:116:13 | 116 | 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#L92
warning: redundant field names in struct initialization --> src/config/req.rs:92:13 | 92 | 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#L66
warning: redundant field names in struct initialization --> src/config/req.rs:66:13 | 66 | 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#L46
warning: redundant field names in struct initialization --> src/config/req.rs:46:13 | 46 | 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
unused import: `naming::ServiceInstancesChangeEvent`: src/config/req.rs#L20
warning: unused import: `naming::ServiceInstancesChangeEvent` --> src/config/req.rs:20:5 | 20 | naming::ServiceInstancesChangeEvent, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unused import: `collections::HashMap`: src/config/req.rs#L16
warning: unused import: `collections::HashMap` --> src/config/req.rs:16:11 | 16 | use std::{collections::HashMap, sync::Arc, time::Duration}; | ^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` 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/req.rs#L16
unused import: `collections::HashMap`
Run tests: src/config/req.rs#L20
unused import: `naming::ServiceInstancesChangeEvent`
Run tests: src/config/api.rs#L27
unused import: `DeleteConfigFileRequest`
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`
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/