Nightly builds on latest release #4
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
16 errors and 509 warnings
build (ubuntu-20.04, stable, schedule)
Process completed with exit code 100.
|
build (ubuntu-20.04, stable, schedule)
failed to run custom build command for `pango-sys v0.14.0`
|
build (ubuntu-20.04, stable, schedule)
The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
|
build (ubuntu-20.04, beta, schedule)
failed to run custom build command for `pango-sys v0.14.0`
|
build (ubuntu-20.04, beta, schedule)
The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
|
build (ubuntu-20.04, beta, schedule)
Process completed with exit code 100.
|
build (macos-latest, stable, schedule):
common/crypto/src/hkdf.rs#L25
unnecessary closure used to substitute value for `Option::None`
|
build (macos-latest, stable, schedule)
could not compile `crypto` (lib) due to previous error
|
build (macos-latest, stable, schedule)
The process '/Users/runner/.cargo/bin/cargo' failed with exit code 101
|
build (macos-latest, beta, schedule):
common/crypto/src/hkdf.rs#L25
unnecessary closure used to substitute value for `Option::None`
|
build (macos-latest, beta, schedule)
could not compile `crypto` (lib) due to previous error
|
build (macos-latest, beta, schedule)
The process '/Users/runner/.cargo/bin/cargo' failed with exit code 101
|
build (windows10, beta, schedule)
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
|
build (windows10, stable, schedule)
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
|
build (windows10, nightly, schedule)
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
|
notification
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
|
build (ubuntu-20.04, stable, schedule)
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/
|
build (ubuntu-20.04, stable, schedule)
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/
|
build (ubuntu-20.04, stable, schedule)
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/
|
build (ubuntu-20.04, stable, schedule)
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/
|
build (ubuntu-20.04, stable, schedule)
`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "pango" "pango >= 1.38"` did not exit successfully: exit status: 1
|
build (ubuntu-20.04, beta, schedule)
`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "pango" "pango >= 1.38"` did not exit successfully: exit status: 1
|
build (ubuntu-20.04, beta, schedule)
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/
|
build (ubuntu-20.04, beta, schedule)
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/
|
build (ubuntu-20.04, beta, schedule)
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/
|
build (ubuntu-20.04, beta, schedule)
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/
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L208
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:208:5
|
198 | / let delegates = match client
199 | | .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
200 | | .await
201 | | {
... |
206 | | }
207 | | };
| |______- unnecessary `let` binding
208 | delegates
| ^^^^^^^^^
|
= 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
|
198 ~
199 ~ match client
200 + .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
201 + .await
202 + {
203 + Ok(result) => result,
204 + Err(e) => {
205 + error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
206 + vec![]
207 + }
208 + }
|
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|
build (macos-latest, stable, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, stable, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, stable, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, stable, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, stable, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, stable, schedule)
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/
|
build (macos-latest, stable, schedule)
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/
|
build (macos-latest, stable, schedule)
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/
|
build (macos-latest, stable, schedule)
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/
|
build (macos-latest, stable, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, stable, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, stable, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, stable, schedule)
`nym-socks5-client` (bin "nym-socks5-client" test) generated 1 warning (1 duplicate)
|
build (macos-latest, stable, schedule)
`nym-socks5-client` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, stable, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, stable, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, stable, schedule)
1 warning emitted
|
build (macos-latest, stable, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, stable, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, stable, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, stable, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, stable, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, stable, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, stable, schedule)
`nymcoconut` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, stable, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, stable, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, stable, schedule)
`nym-socks5-client` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, stable, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L208
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:208:5
|
198 | / let delegates = match client
199 | | .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
200 | | .await
201 | | {
... |
206 | | }
207 | | };
| |______- unnecessary `let` binding
208 | delegates
| ^^^^^^^^^
|
= 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
|
198 ~
199 ~ match client
200 + .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
201 + .await
202 + {
203 + Ok(result) => result,
204 + Err(e) => {
205 + error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
206 + vec![]
207 + }
208 + }
|
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|
build (macos-latest, beta, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, beta, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, beta, schedule)
`nymcoconut` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, beta, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, beta, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, beta, schedule)
`nym-socks5-client` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, beta, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, beta, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, beta, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, beta, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, beta, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, beta, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, beta, schedule)
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/
|
build (macos-latest, beta, schedule)
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/
|
build (macos-latest, beta, schedule)
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/
|
build (macos-latest, beta, schedule)
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/
|
build (macos-latest, beta, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, beta, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, beta, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, beta, schedule)
`nym-socks5-client` (bin "nym-socks5-client" test) generated 1 warning (1 duplicate)
|
build (macos-latest, beta, schedule)
`nym-socks5-client` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, beta, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, beta, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, beta, schedule)
1 warning emitted
|
build (macos-latest, beta, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, beta, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, beta, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, beta, schedule)
`client-core` (lib) generated 2 warnings
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L208
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:208:5
|
198 | / let delegates = match client
199 | | .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
200 | | .await
201 | | {
... |
206 | | }
207 | | };
| |______- unnecessary `let` binding
208 | delegates
| ^^^^^^^^^
|
= 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
|
198 ~
199 ~ match client
200 + .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
201 + .await
202 + {
203 + Ok(result) => result,
204 + Err(e) => {
205 + error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
206 + vec![]
207 + }
208 + }
|
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|
build (macos-latest, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, nightly, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, nightly, schedule)
`nym-socks5-client` (bin "nym-socks5-client" test) generated 1 warning (1 duplicate)
|
build (macos-latest, nightly, schedule)
`nym-socks5-client` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, nightly, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, nightly, schedule)
1 warning emitted
|
build (macos-latest, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1
|
build (macos-latest, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib test) generated 1 warning (1 duplicate)
|
build (macos-latest, nightly, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, nightly, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, nightly, schedule)
`nym-socks5-client` (bin "nym-socks5-client" test) generated 1 warning (1 duplicate)
|
build (macos-latest, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, nightly, schedule)
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/
|
build (macos-latest, nightly, schedule)
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/
|
build (macos-latest, nightly, schedule)
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/
|
build (macos-latest, nightly, schedule)
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/
|
build (macos-latest, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (macos-latest, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (macos-latest, nightly, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (macos-latest, nightly, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (macos-latest, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (macos-latest, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (macos-latest, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (macos-latest, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L174
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:174:21
|
174 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L208
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:208:5
|
198 | / let delegates = match client
199 | | .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
200 | | .await
201 | | {
... |
206 | | }
207 | | };
| |______- unnecessary `let` binding
208 | delegates
| ^^^^^^^^^
|
= 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
|
198 ~
199 ~ match client
200 + .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
201 + .await
202 + {
203 + Ok(result) => result,
204 + Err(e) => {
205 + error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
206 + vec![]
207 + }
208 + }
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
build (ubuntu-20.04, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (ubuntu-20.04, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib test) generated 1 warning (1 duplicate)
|
build (ubuntu-20.04, nightly, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (ubuntu-20.04, nightly, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (ubuntu-20.04, nightly, schedule)
`nym-socks5-client` (bin "nym-socks5-client" test) generated 1 warning (1 duplicate)
|
build (ubuntu-20.04, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (ubuntu-20.04, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (ubuntu-20.04, nightly, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (ubuntu-20.04, nightly, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (ubuntu-20.04, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (ubuntu-20.04, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (ubuntu-20.04, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1
|
build (ubuntu-20.04, nightly, schedule)
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/
|
build (ubuntu-20.04, nightly, schedule)
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/
|
build (ubuntu-20.04, nightly, schedule)
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/
|
build (ubuntu-20.04, nightly, schedule)
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/
|
build (ubuntu-20.04, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (ubuntu-20.04, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib test) generated 1 warning (1 duplicate)
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/cover_traffic_stream.rs#L153
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule):
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
unused output of future returned by `tokio::task::yield_now` that must be used
|
build (ubuntu-20.04, nightly, schedule)
`client-core` (lib) generated 2 warnings
|
build (ubuntu-20.04, nightly, schedule):
clients/socks5/src/socks/utils.rs#L14
unnecessary parentheses around index expression
|
build (ubuntu-20.04, nightly, schedule)
`nym-socks5-client` (lib) generated 1 warning (run `cargo fix --lib -p nym-socks5-client` to apply 1 suggestion)
|
build (ubuntu-20.04, nightly, schedule)
`nym-socks5-client` (bin "nym-socks5-client" test) generated 1 warning (1 duplicate)
|
build (ubuntu-20.04, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: criterion v0.3.5, html5ever v0.25.1, sqlx-macros v0.5.7, ubyte v0.10.1
|
build (ubuntu-20.04, nightly, schedule):
common/nymcoconut/src/error.rs#L45
named argument `object` is not used by name
|
build (ubuntu-20.04, nightly, schedule)
`nymcoconut` (lib) generated 1 warning
|
build (ubuntu-20.04, nightly, schedule)
the following packages contain code that will be rejected by a future version of Rust: html5ever v0.25.1
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L165
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:165:21
|
165 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L208
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:208:5
|
198 | / let delegates = match client
199 | | .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
200 | | .await
201 | | {
... |
206 | | }
207 | | };
| |______- unnecessary `let` binding
208 | delegates
| ^^^^^^^^^
|
= 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
|
198 ~
199 ~ match client
200 + .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
201 + .await
202 + {
203 + Ok(result) => result,
204 + Err(e) => {
205 + error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
206 + vec![]
207 + }
208 + }
|
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L165
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:165:21
|
165 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L165
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:165:21
|
165 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L208
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:208:5
|
198 | / let delegates = match client
199 | | .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
200 | | .await
201 | | {
... |
206 | | }
207 | | };
| |______- unnecessary `let` binding
208 | delegates
| ^^^^^^^^^
|
= 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
|
198 ~
199 ~ match client
200 + .get_all_nymd_single_mixnode_delegations(pubkey.to_string())
201 + .await
202 + {
203 + Ok(result) => result,
204 + Err(e) => {
205 + error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
206 + vec![]
207 + }
208 + }
|
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L165
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:165:21
|
165 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|
this boolean expression can be simplified:
validator-api/src/main.rs#L305
warning: this boolean expression can be simplified
--> validator-api/src/main.rs:305:13
|
305 | !(monitor_threshold > 100),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `monitor_threshold <= 100`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L126
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:126:9
|
126 | Ok(self.0.read().await.get_epoch_reward_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_epoch_reward_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L119
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:119:9
|
119 | Ok(self.0.read().await.get_sybil_resistance_percent().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_sybil_resistance_percent().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L112
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:112:9
|
112 | Ok(self.0.read().await.get_circulating_supply().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_circulating_supply().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
validator-api/src/nymd_client.rs#L105
warning: question mark operator is useless here
--> validator-api/src/nymd_client.rs:105:9
|
105 | Ok(self.0.read().await.get_reward_pool().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.0.read().await.get_reward_pool().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
deref which would be done by auto-deref:
validator-api/src/network_monitor/monitor/processor.rs#L144
warning: deref which would be done by auto-deref
--> validator-api/src/network_monitor/monitor/processor.rs:144:68
|
144 | let permit = wait_for_permit(&mut permit_receiver, &*inner).await;
| ^^^^^^^ help: try this: `&inner`
|
= 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
|
iterating on a map's values:
validator-api/src/network_monitor/monitor/preparer.rs#L526
warning: iterating on a map's values
--> validator-api/src/network_monitor/monitor/preparer.rs:526:23
|
526 | let packets = all_gateway_packets.into_iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all_gateway_packets.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
mixnode/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> mixnode/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/native/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/native/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/native/src/commands/init.rs#L165
warning: deref which would be done by auto-deref
--> clients/native/src/commands/init.rs:165:21
|
165 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
returning the result of a `let` binding from a block:
explorer-api/src/mix_nodes/mod.rs#L220
warning: returning the result of a `let` binding from a block
--> explorer-api/src/mix_nodes/mod.rs:220:5
|
213 | / let delegates = match client.get_all_network_delegations().await {
214 | | Ok(result) => result,
215 | | Err(e) => {
216 | | error!("Could not get all mix delegations: {:?}", e);
217 | | vec![]
218 | | }
219 | | };
| |______- unnecessary `let` binding
220 | delegates
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ match client.get_all_network_delegations().await {
215 + Ok(result) => result,
216 + Err(e) => {
217 + error!("Could not get all mix delegations: {:?}", e);
218 + vec![]
219 + }
220 + }
|
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L125
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:125:30
|
125 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
clients/socks5/src/commands/upgrade.rs#L108
warning: the borrowed expression implements the required traits
--> clients/socks5/src/commands/upgrade.rs:108:25
|
108 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
deref which would be done by auto-deref:
clients/socks5/src/commands/init.rs#L165
warning: deref which would be done by auto-deref
--> clients/socks5/src/commands/init.rs:165:21
|
165 | .expect(&*format!("no gateway with id {} exists!", gateway_id))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("no gateway with id {} exists!", gateway_id)`
|
= 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
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L122
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:122:30
|
122 | print_failed_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
gateway/src/commands/upgrade.rs#L109
warning: the borrowed expression implements the required traits
--> gateway/src/commands/upgrade.rs:109:25
|
109 | print_start_upgrade(&config_version, &to_version);
| ^^^^^^^^^^^^^^^ help: change this to: `config_version`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
returning the result of a `let` binding from a block:
service-providers/network-requester/src/core.rs#L278
warning: returning the result of a `let` binding from a block
--> service-providers/network-requester/src/core.rs:278:9
|
269 | / let ws_stream = match websocket::Connection::new(uri).connect().await {
270 | | Ok(ws_stream) => {
271 | | info!("* connected to local websocket server at {}", uri);
272 | | ws_stream
... |
276 | | }
277 | | };
| |__________- unnecessary `let` binding
278 | ws_stream
| ^^^^^^^^^
|
= 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
|
269 ~
270 ~ match websocket::Connection::new(uri).connect().await {
271 + Ok(ws_stream) => {
272 + info!("* connected to local websocket server at {}", uri);
273 + ws_stream
274 + }
275 + Err(WebsocketConnectionError::ConnectionNotEstablished) => {
276 + panic!("Error: websocket connection attempt failed, is the Nym client running?")
277 + }
278 + }
|
|
unnecessary parentheses around index expression:
clients/socks5/src/socks/utils.rs#L14
warning: unnecessary parentheses around index expression
--> clients/socks5/src/socks/utils.rs:14:42
|
14 | .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
14 - .map(|x| (u16::from(addr[(x * 2)]) << 8) | u16::from(addr[(x * 2) + 1]))
14 + .map(|x| (u16::from(addr[x * 2]) << 8) | u16::from(addr[(x * 2) + 1]))
|
|
deref which would be done by auto-deref:
common/client-libs/mixnet-client/src/client.rs#L184
warning: deref which would be done by auto-deref
--> common/client-libs/mixnet-client/src/client.rs:184:17
|
184 | &*current_reconnection_attempt,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `¤t_reconnection_attempt`
|
= 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
|
deref which would be done by auto-deref:
gateway/build.rs#L10
warning: deref which would be done by auto-deref
--> gateway/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
deref which would be done by auto-deref:
validator-api/build.rs#L10
warning: deref which would be done by auto-deref
--> validator-api/build.rs:10:46
|
10 | let mut conn = SqliteConnection::connect(&*format!("sqlite://{}?mode=rwc", database_path))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&format!("sqlite://{}?mode=rwc", database_path)`
|
= 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
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L249
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:249:9
|
249 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
help: use `let _ = ...` to ignore the resulting value
|
249 | let _ = tokio::task::yield_now().await;
| +++++++
|
unused output of future returned by `tokio::task::yield_now` that must be used:
clients/client-core/src/client/cover_traffic_stream.rs#L153
warning: unused output of future returned by `tokio::task::yield_now` that must be used
--> clients/client-core/src/client/cover_traffic_stream.rs:153:9
|
153 | tokio::task::yield_now().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: yield_now does nothing unless polled/`await`-ed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
153 | let _ = tokio::task::yield_now().await;
| +++++++
|
manual implementation of `Option::filter`:
clients/client-core/src/client/topology_control.rs#L61
warning: manual implementation of `Option::filter`
--> clients/client-core/src/client/topology_control.rs:61:9
|
61 | / match topology_ref_option {
62 | | None => None,
63 | | Some(topology_ref) => {
64 | | // see if it's possible to route the packet to both gateways
... |
77 | | }
78 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
= note: `#[warn(clippy::manual_filter)]` on by default
help: try this
|
61 ~ topology_ref_option.as_ref().filter(|topology_ref| !(!topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
62 + || !topology_ref.gateway_exists(ack_recipient.gateway()) || if let Some(packet_recipient) = packet_recipient {
63 + !topology_ref.gateway_exists(packet_recipient.gateway())
64 + } else {
65 + false
66 + }))
|
|
the borrowed expression implements the required traits:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: the borrowed expression implements the required traits
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `key_digest.to_vec()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L82
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:82:51
|
82 | let removal_result = match self.db.remove(&key_digest.to_vec()) {
| ^^^^^^^^^^^^^^^^^^^^ help: use: `key_digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
clients/client-core/src/client/reply_key_storage.rs#L62
warning: unnecessary use of `to_vec`
--> clients/client-core/src/client/reply_key_storage.rs:62:53
|
62 | let insertion_result = match self.db.insert(digest.to_vec(), encryption_key.to_bytes()) {
| ^^^^^^^^^^^^^^^ help: use: `digest`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
deref which would be done by auto-deref:
clients/client-core/src/client/real_messages_control/real_traffic_stream.rs#L225
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/real_messages_control/real_traffic_stream.rs:225:21
|
225 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L84
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:84:50
|
84 | let ack_key: AckKey = pemstore::load_key(&client_pathfinder.ack_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.ack_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_owned`:
clients/client-core/src/client/key_manager.rs#L82
warning: unnecessary use of `to_owned`
--> clients/client-core/src/client/key_manager.rs:82:32
|
82 | pemstore::load_key(&client_pathfinder.gateway_shared_key().to_owned())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `client_pathfinder.gateway_shared_key()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
deref which would be done by auto-deref:
clients/client-core/src/client/cover_traffic_stream.rs#L133
warning: deref which would be done by auto-deref
--> clients/client-core/src/client/cover_traffic_stream.rs:133:13
|
133 | &*self.ack_key,
| ^^^^^^^^^^^^^^ help: try this: `&self.ack_key`
|
= 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
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L153
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:153:20
|
153 | .chain(self.mac_key.to_vec().into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.mac_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
|
unnecessary use of `to_vec`:
gateway/gateway-requests/src/registration/handshake/shared_key.rs#L150
warning: unnecessary use of `to_vec`
--> gateway/gateway-requests/src/registration/handshake/shared_key.rs:150:9
|
150 | / self.encryption_key
151 | | .to_vec()
152 | | .into_iter()
| |________________________^ help: use: `self.encryption_key.iter().copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
the borrowed expression implements the required traits:
common/client-libs/validator-client/src/nymd/wallet/mod.rs#L75
warning: the borrowed expression implements the required traits
--> common/client-libs/validator-client/src/nymd/wallet/mod.rs:75:59
|
75 | let extended_private_key = XPrv::derive_from_path(&self.seed, hd_path)?;
| ^^^^^^^^^^ help: change this to: `self.seed`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
called `map(..).flatten()` on `Option`:
common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs#L165
warning: called `map(..).flatten()` on `Option`
--> common/client-libs/validator-client/src/nymd/cosmwasm_client/signing_client.rs:165:18
|
165 | .map(|options| options.admin.take())
| __________________^
166 | | .flatten(),
| |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|options| options.admin.take())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
question mark operator is useless here:
common/client-libs/validator-client/src/client.rs#L197
warning: question mark operator is useless here
--> common/client-libs/validator-client/src/client.rs:197:9
|
197 | Ok(self.nymd.get_mixnet_contract_version().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.nymd.get_mixnet_contract_version().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary use of `to_vec`:
common/nymsphinx/src/preparer/mod.rs#L390
warning: unnecessary use of `to_vec`
--> common/nymsphinx/src/preparer/mod.rs:390:17
|
390 | / reply_surb
391 | | .encryption_key()
392 | | .compute_digest()
393 | | .to_vec()
394 | | .into_iter(),
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: use
|
390 ~ reply_surb
391 + .encryption_key()
392 ~ .compute_digest().iter().copied(),
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L100
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:100:13
|
100 | i as usize * unlinked_fragment_payload_max_len(max_plaintext_size),
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
common/nymsphinx/chunking/src/set.rs#L97
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> common/nymsphinx/chunking/src/set.rs:97:19
|
97 | let lb = (i as usize - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
| ^^^^^^^^^^ help: try: `i`
|
= 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
|
deref which would be done by auto-deref:
common/nymcoconut/src/scheme/issuance.rs#L231
warning: deref which would be done by auto-deref
--> common/nymcoconut/src/scheme/issuance.rs:231:9
|
231 | &*private_attributes_ciphertexts,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&private_attributes_ciphertexts`
|
= 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
|
named argument `object` is not used by name:
common/nymcoconut/src/error.rs#L45
warning: named argument `object` is not used by name
--> common/nymcoconut/src/error.rs:45:13
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {} or {modulus_target} % {modulus} == 0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | this formatting argument uses named argument `object` by position
| this named argument is referred to by position in formatting string
|
= note: `#[warn(named_arguments_used_positionally)]` on by default
help: use the named argument by name to avoid ambiguity
|
45 | #[error("Tried to deserialize {object} with bytes of invalid length. Expected {actual} < {object} or {modulus_target} % {modulus} == 0")]
| ++++++
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_sizes.rs#L79
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_sizes.rs:79:1
|
79 | / impl Default for PacketSize {
80 | | fn default() -> Self {
81 | | PacketSize::RegularPacket
82 | | }
83 | | }
| |_^
|
= 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...
|
25 + #[derive(Default)]
26 | pub enum PacketSize {
|
help: ...and mark the default variant
|
27 ~ #[default]
28 ~ RegularPacket = 1,
|
|
this `impl` can be derived:
common/nymsphinx/params/src/packet_modes.rs#L43
warning: this `impl` can be derived
--> common/nymsphinx/params/src/packet_modes.rs:43:1
|
43 | / impl Default for PacketMode {
44 | | fn default() -> Self {
45 | | PacketMode::Mix
46 | | }
47 | | }
| |_^
|
= 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...
|
11 + #[derive(Default)]
12 | pub enum PacketMode {
|
help: ...and mark the default variant
|
14 ~ #[default]
15 ~ Mix = 0,
|
|
unnecessary closure used to substitute value for `Option::None`:
common/crypto/src/hkdf.rs#L25
warning: unnecessary closure used to substitute value for `Option::None`
--> common/crypto/src/hkdf.rs:25:17
|
25 | hkdf.expand(info.unwrap_or_else(|| &[]), &mut okm)?;
| ^^^^^----------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(&[])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
|