Change owner to identityOperator (#549) #74
update-deployment.yaml
on: push
update-deployment
3s
Annotations
137 warnings
unused `async` for function with no await statements:
src/prover/mod.rs#L698
warning: unused `async` for function with no await statements
--> src/prover/mod.rs:698:9
|
698 | / pub async fn new(url: String) -> anyhow::Result<Self> {
699 | | let prove = |Json(payload): Json<InsertionProofInput>| async move {
700 | | match payload.post_root.div_mod(U256::from(2)) {
701 | | (_, y) if y != U256::zero() => {
... |
729 | | Ok(service)
730 | | }
| |_________^
|
= help: consider removing the `async` from this function
note: `await` used in an async block, which does not require the enclosing function to be `async`
--> src/prover/mod.rs:724:22
|
724 | .await
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
= note: `#[warn(clippy::unused_async)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function returning `Result` missing `# Errors` section:
src/utils.rs#L28
warning: docs for function returning `Result` missing `# Errors` section
--> src/utils.rs:28:5
|
28 | fn any_flatten(self) -> AnyhowResult<A>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/utils.rs#L15
warning: docs for function returning `Result` missing `# Errors` section
--> src/utils.rs:15:5
|
15 | fn any(self) -> AnyhowResult<A>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
|
this function could have a `#[must_use]` attribute:
src/utils/tree_updates.rs#L3
warning: this function could have a `#[must_use]` attribute
--> src/utils/tree_updates.rs:3:1
|
3 | pub fn dedup_tree_updates(updates: Vec<TreeUpdate>) -> Vec<TreeUpdate> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn dedup_tree_updates(updates: Vec<TreeUpdate>) -> Vec<TreeUpdate>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
docs for function which may panic missing `# Panics` section:
src/utils/index_packing.rs#L11
warning: docs for function which may panic missing `# Panics` section
--> src/utils/index_packing.rs:11:1
|
11 | pub fn unpack_indices(packed: &[u8]) -> Vec<u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/utils/index_packing.rs:15:40
|
15 | let index = u32::from_be_bytes(packed_index.try_into().expect("Invalid index length"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
this function could have a `#[must_use]` attribute:
src/utils/index_packing.rs#L11
warning: this function could have a `#[must_use]` attribute
--> src/utils/index_packing.rs:11:1
|
11 | pub fn unpack_indices(packed: &[u8]) -> Vec<u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn unpack_indices(packed: &[u8]) -> Vec<u32>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
this function could have a `#[must_use]` attribute:
src/utils/index_packing.rs#L1
warning: this function could have a `#[must_use]` attribute
--> src/utils/index_packing.rs:1:1
|
1 | pub fn pack_indices(indices: &[u32]) -> Vec<u8> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pack_indices(indices: &[u32]) -> Vec<u8>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: `#[warn(clippy::must_use_candidate)]` implied by `#[warn(clippy::pedantic)]`
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/task_monitor.rs:46:5
|
46 | / register_histogram!(
47 | | "submitted_batch_sizes",
48 | | "Submitted batch size",
49 | | linear_buckets(f64::from(1), f64::from(1), 100).unwrap()
50 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L546
warning: matching over `()` is more explicit
--> src/task_monitor.rs:38:5
|
38 | / register_gauge!(
39 | | "unprocessed_identities",
40 | | "Identities not processed by identity committer"
41 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_gauge` which comes from the expansion of the macro `register_gauge` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L546
warning: matching over `()` is more explicit
--> src/task_monitor.rs:34:5
|
34 | register_gauge!("pending_identities", "Identities not submitted on-chain").unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_gauge` which comes from the expansion of the macro `register_gauge` (in Nightly builds, run with -Z macro-backtrace for more info)
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/task_monitor/tasks/process_identities.rs#L503
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/task_monitor/tasks/process_identities.rs:503:31
|
503 | let pad_index = 2_u32.pow(latest_tree_from_updates.depth() as u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
503 | let pad_index = 2_u32.pow(u32::try_from(latest_tree_from_updates.depth()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/task_monitor/tasks/process_identities.rs#L462
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/task_monitor/tasks/process_identities.rs:462:18
|
462 | .map(|f| f.update.leaf_index as u32)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
462 | .map(|f| u32::try_from(f.update.leaf_index))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
variables can be used directly in the `format!` string:
src/task_monitor/tasks/process_identities.rs#L289
warning: variables can be used directly in the `format!` string
--> src/task_monitor/tasks/process_identities.rs:289:13
|
289 | / panic!(
290 | | "Identities are not consecutive leaves in the tree (leaf_indexes = {:?}, \
291 | | commitments = {:?})",
292 | | leaf_indexes, commitments
293 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
unnecessary `!=` operation:
src/task_monitor/tasks/process_identities.rs#L216
warning: unnecessary `!=` operation
--> src/task_monitor/tasks/process_identities.rs:216:17
|
216 | let tx_id = if updates
| _________________^
217 | | .first()
218 | | .context("Updates should be > 1")?
219 | | .update
... |
245 | | delete_identities(database, identity_manager, batching_tree, updates, prover).await?
246 | | };
| |_____^
|
= help: change to `==` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`
|
variables can be used directly in the `format!` string:
src/task_monitor/tasks/monitor_txs.rs#L40
warning: variables can be used directly in the `format!` string
--> src/task_monitor/tasks/monitor_txs.rs:40:13
|
40 | panic!("Failed to mine transaction: {}", tx);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
40 - panic!("Failed to mine transaction: {}", tx);
40 + panic!("Failed to mine transaction: {tx}");
|
|
only a `panic!` in `if`-then statement:
src/task_monitor/tasks/monitor_txs.rs#L39
warning: only a `panic!` in `if`-then statement
--> src/task_monitor/tasks/monitor_txs.rs:39:9
|
39 | / if !identity_manager.mine_transaction(tx.clone()).await? {
40 | | panic!("Failed to mine transaction: {}", tx);
41 | | }
| |_________^ help: try instead: `assert!((identity_manager.mine_transaction(tx.clone()).await?), "Failed to mine transaction: {}", tx);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert
= note: `#[warn(clippy::manual_assert)]` implied by `#[warn(clippy::pedantic)]`
|
casting `u64` to `i64` may wrap around the value:
src/task_monitor/tasks/finalize_identities.rs#L332
warning: casting `u64` to `i64` may wrap around the value
--> src/task_monitor/tasks/finalize_identities.rs:332:35
|
332 | chrono::Duration::seconds(root_history_expiry.as_u64() as i64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::cast_possible_wrap)]` implied by `#[warn(clippy::pedantic)]`
|
redundant closure:
src/task_monitor/tasks/finalize_identities.rs#L314
warning: redundant closure
--> src/task_monitor/tasks/finalize_identities.rs:314:62
|
314 | let commitments: Vec<U256> = commitments.into_iter().map(|c| c.into()).collect();
| ^^^^^^^^^^^^ help: replace the closure with the method itself: `std::convert::Into::into`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
= note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/task_monitor/tasks/finalize_identities.rs#L203
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/task_monitor/tasks/finalize_identities.rs:203:17
|
203 | &log,
| ^^^^ help: change this to: `log`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
|
this function has too many arguments (8/7):
src/task_monitor/tasks/finalize_identities.rs#L70
warning: this function has too many arguments (8/7)
--> src/task_monitor/tasks/finalize_identities.rs:70:1
|
70 | / async fn finalize_roots_loop(
71 | | database: &Database,
72 | | identity_manager: &IdentityManager,
73 | | processed_tree: &TreeVersion<Intermediate>,
... |
78 | | max_epoch_duration: Duration,
79 | | ) -> AnyhowResult<()> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
src/task_monitor/tasks/finalize_identities.rs#L33
warning: this function has too many arguments (8/7)
--> src/task_monitor/tasks/finalize_identities.rs:33:5
|
33 | / pub fn new(
34 | | database: Arc<Database>,
35 | | identity_manager: SharedIdentityManager,
36 | | processed_tree: TreeVersion<Intermediate>,
... |
41 | | max_epoch_duration: Duration,
42 | | ) -> Arc<Self> {
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:23:5
|
23 | register_histogram!("api_latency_seconds", "The API latency in seconds.").unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:14:5
|
14 | / register_int_counter_vec!(
15 | | "api_response_status",
16 | | "The API responses by status code.",
17 | | &["status_code"]
18 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L217
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:11:18
|
11 | Lazy::new(|| register_counter!(opts!("api_requests", "Number of requests received.")).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_counter` (in Nightly builds, run with -Z macro-backtrace for more info)
|
docs for function which may panic missing `# Panics` section:
src/server/error.rs#L73
warning: docs for function which may panic missing `# Panics` section
--> src/server/error.rs:73:5
|
73 | pub fn to_response(&self) -> hyper::Response<Body> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/server/error.rs:88:9
|
88 | / hyper::Response::builder()
89 | | .status(status_code)
90 | | .body(hyper::Body::from(self.to_string()))
91 | | .expect("Failed to convert error string into hyper::Body")
| |______________________________________________________________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
this argument is passed by value, but not consumed in the function body:
src/prover/mod.rs#L359
warning: this argument is passed by value, but not consumed in the function body
--> src/prover/mod.rs:359:23
|
359 | deletion_indices: Vec<u32>,
| ^^^^^^^^ help: consider changing the type to: `&[u32]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: `#[warn(clippy::needless_pass_by_value)]` implied by `#[warn(clippy::pedantic)]`
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/prover/mod.rs:47:5
|
47 | / register_histogram!(
48 | | "prover_proving_time",
49 | | "Only the time between sending a request and receiving the proof",
50 | | exponential_buckets(0.1, 1.5, 25).unwrap()
51 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/prover/mod.rs:38:5
|
38 | / register_histogram!(
39 | | "total_proving_time",
40 | | "The time to generate a proof in seconds. Includes preparing the data for the prover",
41 | | exponential_buckets(0.1, 1.5, 25).unwrap()
42 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
docs for function which may panic missing `# Panics` section:
src/identity_tree.rs#L578
warning: docs for function which may panic missing `# Panics` section
--> src/identity_tree.rs:578:5
|
578 | / pub fn new(
579 | | tree_depth: usize,
580 | | dense_prefix_depth: usize,
581 | | flattening_threshold: usize,
... |
584 | | mmap_file_path: &str,
585 | | ) -> Self {
| |_____________^
|
note: first possible panic found here
--> src/identity_tree.rs:591:13
|
591 | / PoseidonTree::<lazy_merkle_tree::Canonical>::new_mmapped_with_dense_prefix_with_init_values(
592 | | tree_depth,
593 | | dense_prefix_depth,
594 | | &initial_leaf,
595 | | initial_leaves_in_dense,
596 | | mmap_file_path
597 | | ).unwrap();
| |______________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
single-character string constant used as pattern:
src/identity_tree/status.rs#L144
warning: single-character string constant used as pattern
--> src/identity_tree/status.rs:144:30
|
144 | s.trim_start_matches("\"").trim_end_matches("\"")
| ^^^^ help: try using a `char` instead: `'\"'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
|
single-character string constant used as pattern:
src/identity_tree/status.rs#L144
warning: single-character string constant used as pattern
--> src/identity_tree/status.rs:144:53
|
144 | s.trim_start_matches("\"").trim_end_matches("\"")
| ^^^^ help: try using a `char` instead: `'\"'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` implied by `#[warn(clippy::all)]`
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/ethereum/write_oz/openzeppelin.rs:19:5
|
19 | / register_int_counter_vec!("eth_tx_count", "The transaction count by bytes4.", &[
20 | | "bytes4"
21 | | ])
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/ethereum/read/rpc_logger.rs:20:5
|
20 | / register_histogram!(
21 | | "eth_rpc_latency_seconds",
22 | | "The Ethereum provider latency in seconds."
23 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/ethereum/read/rpc_logger.rs:12:5
|
12 | / register_int_counter_vec!(
13 | | "eth_rpc_requests",
14 | | "Number of Ethereum provider requests made by method.",
15 | | &["method"]
16 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
variables can be used directly in the `format!` string:
src/database/mod.rs#L676
warning: variables can be used directly in the `format!` string
--> src/database/mod.rs:676:21
|
676 | let query = format!(
| _____________________^
677 | | "DELETE FROM deletions WHERE commitment IN ({})",
678 | | placeholders
679 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/contracts/mod.rs#L384
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/contracts/mod.rs:384:38
|
384 | let padding_index = 2u32.pow(self.tree_depth as u32);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: `#[warn(clippy::cast_possible_truncation)]` implied by `#[warn(clippy::pedantic)]`
help: ... or use `try_from` and handle the error accordingly
|
384 | let padding_index = 2u32.pow(u32::try_from(self.tree_depth));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
adding items after statements is confusing, since items exist from the start of the scope:
src/contracts/mod.rs#L376
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/contracts/mod.rs:376:9
|
376 | use ethers::abi::AbiDecode;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
= note: `#[warn(clippy::items_after_statements)]` implied by `#[warn(clippy::pedantic)]`
|
variables can be used directly in the `format!` string:
src/contracts/abi.rs#L28
warning: variables can be used directly in the `format!` string
--> src/contracts/abi.rs:28:18
|
28 | _ => panic!("Invalid value for TreeChangeKind: {}", value),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
help: change this to
|
28 - _ => panic!("Invalid value for TreeChangeKind: {}", value),
28 + _ => panic!("Invalid value for TreeChangeKind: {value}"),
|
|
called `.iter().count()` on a `Vec`:
src/app.rs#L890
warning: called `.iter().count()` on a `Vec`
--> src/app.rs:890:20
|
890 | assert_eq!(leaves.iter().count(), 2);
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `leaves.len()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count
|
called `.iter().count()` on a `Vec`:
src/app.rs#L869
warning: called `.iter().count()` on a `Vec`
--> src/app.rs:869:47
|
869 | assert_eq!(last_mined_index_in_dense, identities.iter().count());
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `identities.len()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count
= note: `#[warn(clippy::iter_count)]` implied by `#[warn(clippy::all)]`
|
this function has too many arguments (8/7):
src/app.rs#L335
warning: this function has too many arguments (8/7)
--> src/app.rs:335:5
|
335 | / async fn get_cached_tree_state(
336 | | database: &Database,
337 | | tree_depth: usize,
338 | | dense_prefix_depth: usize,
... |
343 | | mmap_file_path: &str,
344 | | ) -> anyhow::Result<Option<TreeState>> {
| |__________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
docs for function which may panic missing `# Panics` section:
src/app.rs#L304
warning: docs for function which may panic missing `# Panics` section
--> src/app.rs:304:5
|
304 | / pub fn get_leftover_leaves_and_update_index(
305 | | index: &mut usize,
306 | | dense_prefix_depth: usize,
307 | | mined_items: &Vec<TreeUpdate>,
308 | | ) -> Vec<ruint::Uint<256, 4>> {
| |_________________________________^
|
note: first possible panic found here
--> src/app.rs:312:28
|
312 | let max_leaf = mined_items.last().map(|item| item.leaf_index).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
note: the lint level is defined here
--> src/lib.rs:2:22
|
2 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
|
this function has too many arguments (8/7):
src/app.rs#L253
warning: this function has too many arguments (8/7)
--> src/app.rs:253:5
|
253 | / async fn restore_or_initialize_tree(
254 | | database: &Database,
255 | | tree_depth: usize,
256 | | dense_prefix_depth: usize,
... |
261 | | force_cache_purge: bool,
262 | | ) -> AnyhowResult<TreeState> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
note: the lint level is defined here
--> src/lib.rs:2:9
|
2 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::too_many_arguments)]` implied by `#[warn(clippy::all)]`
|
the loop variable `i` is used to index `identities_ref`:
tests/recover_identities.rs#L126
warning: the loop variable `i` is used to index `identities_ref`
--> tests/recover_identities.rs:126:14
|
126 | for i in 0..insertion_batch_size {
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
126 | for (i, <item>) in identities_ref.iter().enumerate().take(insertion_batch_size) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
the loop variable `i` is used to index `test_identities`:
tests/delete_identities.rs#L184
warning: the loop variable `i` is used to index `test_identities`
--> tests/delete_identities.rs:184:14
|
184 | for i in deletion_batch_size + 1..insertion_batch_size {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator and enumerate()
|
184 | for (i, <item>) in test_identities.iter().enumerate().take(insertion_batch_size).skip(deletion_batch_size + 1) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
the loop variable `i` is used to index `test_identities`:
tests/delete_identities.rs#L169
warning: the loop variable `i` is used to index `test_identities`
--> tests/delete_identities.rs:169:14
|
169 | for i in 0..deletion_batch_size {
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator and enumerate()
|
169 | for (i, <item>) in test_identities.iter().enumerate().take(deletion_batch_size) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
the loop variable `i` is used to index `test_identities`:
tests/delete_identities.rs#L136
warning: the loop variable `i` is used to index `test_identities`
--> tests/delete_identities.rs:136:14
|
136 | for i in 0..deletion_batch_size {
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator and enumerate()
|
136 | for (i, <item>) in test_identities.iter().enumerate().take(deletion_batch_size) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
the loop variable `i` is used to index `test_identities`:
tests/delete_identities.rs#L115
warning: the loop variable `i` is used to index `test_identities`
--> tests/delete_identities.rs:115:14
|
115 | for i in 0..insertion_batch_size {
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
115 | for (i, <item>) in test_identities.iter().enumerate().take(insertion_batch_size) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this import is redundant:
tests/dynamic_batch_sizes.rs#L7
warning: this import is redundant
--> tests/dynamic_batch_sizes.rs:7:1
|
7 | use tempfile;
| ^^^^^^^^^^^^^ help: remove it entirely
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
= note: `#[warn(clippy::single_component_path_imports)]` on by default
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
the loop variable `i` is used to index `test_identities`:
tests/delete_padded_identity.rs#L115
warning: the loop variable `i` is used to index `test_identities`
--> tests/delete_padded_identity.rs:115:14
|
115 | for i in 0..insertion_batch_size {
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
115 | for (i, <item>) in test_identities.iter().enumerate().take(insertion_batch_size) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
this function has too many arguments (8/7):
tests/common/mod.rs#L368
warning: this function has too many arguments (8/7)
--> tests/common/mod.rs:368:1
|
368 | #[instrument(skip_all)]
| ^----------------------
| |
| _in this procedural macro expansion
| |
369 | | pub async fn test_recover_identity(
370 | | uri: &str,
371 | | client: &Client<HttpConnector>,
... |
377 | | expect_failure: bool,
378 | | ) -> (merkle_tree::Proof<PoseidonHash>, Field) {
| |______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
|
docs for function returning `Result` missing `# Errors` section:
src/utils.rs#L28
warning: docs for function returning `Result` missing `# Errors` section
--> src/utils.rs:28:5
|
28 | fn any_flatten(self) -> AnyhowResult<A>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/utils.rs#L15
warning: docs for function returning `Result` missing `# Errors` section
--> src/utils.rs:15:5
|
15 | fn any(self) -> AnyhowResult<A>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
|
this function could have a `#[must_use]` attribute:
src/utils/tree_updates.rs#L3
warning: this function could have a `#[must_use]` attribute
--> src/utils/tree_updates.rs:3:1
|
3 | pub fn dedup_tree_updates(updates: Vec<TreeUpdate>) -> Vec<TreeUpdate> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn dedup_tree_updates(updates: Vec<TreeUpdate>) -> Vec<TreeUpdate>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
docs for function which may panic missing `# Panics` section:
src/utils/index_packing.rs#L11
warning: docs for function which may panic missing `# Panics` section
--> src/utils/index_packing.rs:11:1
|
11 | pub fn unpack_indices(packed: &[u8]) -> Vec<u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/utils/index_packing.rs:15:40
|
15 | let index = u32::from_be_bytes(packed_index.try_into().expect("Invalid index length"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
this function could have a `#[must_use]` attribute:
src/utils/index_packing.rs#L11
warning: this function could have a `#[must_use]` attribute
--> src/utils/index_packing.rs:11:1
|
11 | pub fn unpack_indices(packed: &[u8]) -> Vec<u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn unpack_indices(packed: &[u8]) -> Vec<u32>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
this function could have a `#[must_use]` attribute:
src/utils/index_packing.rs#L1
warning: this function could have a `#[must_use]` attribute
--> src/utils/index_packing.rs:1:1
|
1 | pub fn pack_indices(indices: &[u32]) -> Vec<u8> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pack_indices(indices: &[u32]) -> Vec<u8>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: `#[warn(clippy::must_use_candidate)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function returning `Result` missing `# Errors` section:
src/utils.rs#L28
warning: docs for function returning `Result` missing `# Errors` section
--> src/utils.rs:28:5
|
28 | fn any_flatten(self) -> AnyhowResult<A>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/utils.rs#L15
warning: docs for function returning `Result` missing `# Errors` section
--> src/utils.rs:15:5
|
15 | fn any(self) -> AnyhowResult<A>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
|
this function could have a `#[must_use]` attribute:
src/utils/tree_updates.rs#L3
warning: this function could have a `#[must_use]` attribute
--> src/utils/tree_updates.rs:3:1
|
3 | pub fn dedup_tree_updates(updates: Vec<TreeUpdate>) -> Vec<TreeUpdate> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn dedup_tree_updates(updates: Vec<TreeUpdate>) -> Vec<TreeUpdate>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
docs for function which may panic missing `# Panics` section:
src/utils/index_packing.rs#L11
warning: docs for function which may panic missing `# Panics` section
--> src/utils/index_packing.rs:11:1
|
11 | pub fn unpack_indices(packed: &[u8]) -> Vec<u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/utils/index_packing.rs:15:40
|
15 | let index = u32::from_be_bytes(packed_index.try_into().expect("Invalid index length"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
this function could have a `#[must_use]` attribute:
src/utils/index_packing.rs#L11
warning: this function could have a `#[must_use]` attribute
--> src/utils/index_packing.rs:11:1
|
11 | pub fn unpack_indices(packed: &[u8]) -> Vec<u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn unpack_indices(packed: &[u8]) -> Vec<u32>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
|
this function could have a `#[must_use]` attribute:
src/utils/index_packing.rs#L1
warning: this function could have a `#[must_use]` attribute
--> src/utils/index_packing.rs:1:1
|
1 | pub fn pack_indices(indices: &[u32]) -> Vec<u8> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pack_indices(indices: &[u32]) -> Vec<u8>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: `#[warn(clippy::must_use_candidate)]` implied by `#[warn(clippy::pedantic)]`
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/task_monitor.rs:46:5
|
46 | / register_histogram!(
47 | | "submitted_batch_sizes",
48 | | "Submitted batch size",
49 | | linear_buckets(f64::from(1), f64::from(1), 100).unwrap()
50 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L546
warning: matching over `()` is more explicit
--> src/task_monitor.rs:38:5
|
38 | / register_gauge!(
39 | | "unprocessed_identities",
40 | | "Identities not processed by identity committer"
41 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_gauge` which comes from the expansion of the macro `register_gauge` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L546
warning: matching over `()` is more explicit
--> src/task_monitor.rs:34:5
|
34 | register_gauge!("pending_identities", "Identities not submitted on-chain").unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_gauge` which comes from the expansion of the macro `register_gauge` (in Nightly builds, run with -Z macro-backtrace for more info)
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/task_monitor/tasks/process_identities.rs#L503
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/task_monitor/tasks/process_identities.rs:503:31
|
503 | let pad_index = 2_u32.pow(latest_tree_from_updates.depth() as u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
503 | let pad_index = 2_u32.pow(u32::try_from(latest_tree_from_updates.depth()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/task_monitor/tasks/process_identities.rs#L462
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/task_monitor/tasks/process_identities.rs:462:18
|
462 | .map(|f| f.update.leaf_index as u32)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
462 | .map(|f| u32::try_from(f.update.leaf_index))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/task_monitor.rs:46:5
|
46 | / register_histogram!(
47 | | "submitted_batch_sizes",
48 | | "Submitted batch size",
49 | | linear_buckets(f64::from(1), f64::from(1), 100).unwrap()
50 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L546
warning: matching over `()` is more explicit
--> src/task_monitor.rs:38:5
|
38 | / register_gauge!(
39 | | "unprocessed_identities",
40 | | "Identities not processed by identity committer"
41 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_gauge` which comes from the expansion of the macro `register_gauge` (in Nightly builds, run with -Z macro-backtrace for more info)
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/task_monitor/tasks/process_identities.rs#L503
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/task_monitor/tasks/process_identities.rs:503:31
|
503 | let pad_index = 2_u32.pow(latest_tree_from_updates.depth() as u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
503 | let pad_index = 2_u32.pow(u32::try_from(latest_tree_from_updates.depth()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/task_monitor/tasks/process_identities.rs#L462
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/task_monitor/tasks/process_identities.rs:462:18
|
462 | .map(|f| f.update.leaf_index as u32)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
462 | .map(|f| u32::try_from(f.update.leaf_index))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
variables can be used directly in the `format!` string:
src/task_monitor/tasks/process_identities.rs#L289
warning: variables can be used directly in the `format!` string
--> src/task_monitor/tasks/process_identities.rs:289:13
|
289 | / panic!(
290 | | "Identities are not consecutive leaves in the tree (leaf_indexes = {:?}, \
291 | | commitments = {:?})",
292 | | leaf_indexes, commitments
293 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
variables can be used directly in the `format!` string:
src/task_monitor/tasks/process_identities.rs#L289
warning: variables can be used directly in the `format!` string
--> src/task_monitor/tasks/process_identities.rs:289:13
|
289 | / panic!(
290 | | "Identities are not consecutive leaves in the tree (leaf_indexes = {:?}, \
291 | | commitments = {:?})",
292 | | leaf_indexes, commitments
293 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
unnecessary `!=` operation:
src/task_monitor/tasks/process_identities.rs#L216
warning: unnecessary `!=` operation
--> src/task_monitor/tasks/process_identities.rs:216:17
|
216 | let tx_id = if updates
| _________________^
217 | | .first()
218 | | .context("Updates should be > 1")?
219 | | .update
... |
245 | | delete_identities(database, identity_manager, batching_tree, updates, prover).await?
246 | | };
| |_____^
|
= help: change to `==` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`
|
unnecessary `!=` operation:
src/task_monitor/tasks/process_identities.rs#L216
warning: unnecessary `!=` operation
--> src/task_monitor/tasks/process_identities.rs:216:17
|
216 | let tx_id = if updates
| _________________^
217 | | .first()
218 | | .context("Updates should be > 1")?
219 | | .update
... |
245 | | delete_identities(database, identity_manager, batching_tree, updates, prover).await?
246 | | };
| |_____^
|
= help: change to `==` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`
|
variables can be used directly in the `format!` string:
src/task_monitor/tasks/monitor_txs.rs#L40
warning: variables can be used directly in the `format!` string
--> src/task_monitor/tasks/monitor_txs.rs:40:13
|
40 | panic!("Failed to mine transaction: {}", tx);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
40 - panic!("Failed to mine transaction: {}", tx);
40 + panic!("Failed to mine transaction: {tx}");
|
|
only a `panic!` in `if`-then statement:
src/task_monitor/tasks/monitor_txs.rs#L39
warning: only a `panic!` in `if`-then statement
--> src/task_monitor/tasks/monitor_txs.rs:39:9
|
39 | / if !identity_manager.mine_transaction(tx.clone()).await? {
40 | | panic!("Failed to mine transaction: {}", tx);
41 | | }
| |_________^ help: try instead: `assert!((identity_manager.mine_transaction(tx.clone()).await?), "Failed to mine transaction: {}", tx);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert
= note: `#[warn(clippy::manual_assert)]` implied by `#[warn(clippy::pedantic)]`
|
variables can be used directly in the `format!` string:
src/task_monitor/tasks/monitor_txs.rs#L40
warning: variables can be used directly in the `format!` string
--> src/task_monitor/tasks/monitor_txs.rs:40:13
|
40 | panic!("Failed to mine transaction: {}", tx);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
40 - panic!("Failed to mine transaction: {}", tx);
40 + panic!("Failed to mine transaction: {tx}");
|
|
only a `panic!` in `if`-then statement:
src/task_monitor/tasks/monitor_txs.rs#L39
warning: only a `panic!` in `if`-then statement
--> src/task_monitor/tasks/monitor_txs.rs:39:9
|
39 | / if !identity_manager.mine_transaction(tx.clone()).await? {
40 | | panic!("Failed to mine transaction: {}", tx);
41 | | }
| |_________^ help: try instead: `assert!((identity_manager.mine_transaction(tx.clone()).await?), "Failed to mine transaction: {}", tx);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert
= note: `#[warn(clippy::manual_assert)]` implied by `#[warn(clippy::pedantic)]`
|
casting `u64` to `i64` may wrap around the value:
src/task_monitor/tasks/finalize_identities.rs#L332
warning: casting `u64` to `i64` may wrap around the value
--> src/task_monitor/tasks/finalize_identities.rs:332:35
|
332 | chrono::Duration::seconds(root_history_expiry.as_u64() as i64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::cast_possible_wrap)]` implied by `#[warn(clippy::pedantic)]`
|
redundant closure:
src/task_monitor/tasks/finalize_identities.rs#L314
warning: redundant closure
--> src/task_monitor/tasks/finalize_identities.rs:314:62
|
314 | let commitments: Vec<U256> = commitments.into_iter().map(|c| c.into()).collect();
| ^^^^^^^^^^^^ help: replace the closure with the method itself: `std::convert::Into::into`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
= note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
|
casting `u64` to `i64` may wrap around the value:
src/task_monitor/tasks/finalize_identities.rs#L332
warning: casting `u64` to `i64` may wrap around the value
--> src/task_monitor/tasks/finalize_identities.rs:332:35
|
332 | chrono::Duration::seconds(root_history_expiry.as_u64() as i64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::cast_possible_wrap)]` implied by `#[warn(clippy::pedantic)]`
|
redundant closure:
src/task_monitor/tasks/finalize_identities.rs#L314
warning: redundant closure
--> src/task_monitor/tasks/finalize_identities.rs:314:62
|
314 | let commitments: Vec<U256> = commitments.into_iter().map(|c| c.into()).collect();
| ^^^^^^^^^^^^ help: replace the closure with the method itself: `std::convert::Into::into`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
= note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/task_monitor/tasks/finalize_identities.rs#L203
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/task_monitor/tasks/finalize_identities.rs:203:17
|
203 | &log,
| ^^^^ help: change this to: `log`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/task_monitor/tasks/finalize_identities.rs#L203
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/task_monitor/tasks/finalize_identities.rs:203:17
|
203 | &log,
| ^^^^ help: change this to: `log`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
|
this function has too many arguments (8/7):
src/task_monitor/tasks/finalize_identities.rs#L70
warning: this function has too many arguments (8/7)
--> src/task_monitor/tasks/finalize_identities.rs:70:1
|
70 | / async fn finalize_roots_loop(
71 | | database: &Database,
72 | | identity_manager: &IdentityManager,
73 | | processed_tree: &TreeVersion<Intermediate>,
... |
78 | | max_epoch_duration: Duration,
79 | | ) -> AnyhowResult<()> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
src/task_monitor/tasks/finalize_identities.rs#L70
warning: this function has too many arguments (8/7)
--> src/task_monitor/tasks/finalize_identities.rs:70:1
|
70 | / async fn finalize_roots_loop(
71 | | database: &Database,
72 | | identity_manager: &IdentityManager,
73 | | processed_tree: &TreeVersion<Intermediate>,
... |
78 | | max_epoch_duration: Duration,
79 | | ) -> AnyhowResult<()> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
src/task_monitor/tasks/finalize_identities.rs#L33
warning: this function has too many arguments (8/7)
--> src/task_monitor/tasks/finalize_identities.rs:33:5
|
33 | / pub fn new(
34 | | database: Arc<Database>,
35 | | identity_manager: SharedIdentityManager,
36 | | processed_tree: TreeVersion<Intermediate>,
... |
41 | | max_epoch_duration: Duration,
42 | | ) -> Arc<Self> {
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
src/task_monitor/tasks/finalize_identities.rs#L33
warning: this function has too many arguments (8/7)
--> src/task_monitor/tasks/finalize_identities.rs:33:5
|
33 | / pub fn new(
34 | | database: Arc<Database>,
35 | | identity_manager: SharedIdentityManager,
36 | | processed_tree: TreeVersion<Intermediate>,
... |
41 | | max_epoch_duration: Duration,
42 | | ) -> Arc<Self> {
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:23:5
|
23 | register_histogram!("api_latency_seconds", "The API latency in seconds.").unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:14:5
|
14 | / register_int_counter_vec!(
15 | | "api_response_status",
16 | | "The API responses by status code.",
17 | | &["status_code"]
18 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L217
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:11:18
|
11 | Lazy::new(|| register_counter!(opts!("api_requests", "Number of requests received.")).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_counter` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:23:5
|
23 | register_histogram!("api_latency_seconds", "The API latency in seconds.").unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:14:5
|
14 | / register_int_counter_vec!(
15 | | "api_response_status",
16 | | "The API responses by status code.",
17 | | &["status_code"]
18 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L217
warning: matching over `()` is more explicit
--> src/server/custom_middleware/api_metrics_layer.rs:11:18
|
11 | Lazy::new(|| register_counter!(opts!("api_requests", "Number of requests received.")).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_counter` (in Nightly builds, run with -Z macro-backtrace for more info)
|
docs for function which may panic missing `# Panics` section:
src/server/error.rs#L73
warning: docs for function which may panic missing `# Panics` section
--> src/server/error.rs:73:5
|
73 | pub fn to_response(&self) -> hyper::Response<Body> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/server/error.rs:88:9
|
88 | / hyper::Response::builder()
89 | | .status(status_code)
90 | | .body(hyper::Body::from(self.to_string()))
91 | | .expect("Failed to convert error string into hyper::Body")
| |______________________________________________________________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
docs for function which may panic missing `# Panics` section:
src/server/error.rs#L73
warning: docs for function which may panic missing `# Panics` section
--> src/server/error.rs:73:5
|
73 | pub fn to_response(&self) -> hyper::Response<Body> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/server/error.rs:88:9
|
88 | / hyper::Response::builder()
89 | | .status(status_code)
90 | | .body(hyper::Body::from(self.to_string()))
91 | | .expect("Failed to convert error string into hyper::Body")
| |______________________________________________________________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
this argument is passed by value, but not consumed in the function body:
src/prover/mod.rs#L359
warning: this argument is passed by value, but not consumed in the function body
--> src/prover/mod.rs:359:23
|
359 | deletion_indices: Vec<u32>,
| ^^^^^^^^ help: consider changing the type to: `&[u32]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: `#[warn(clippy::needless_pass_by_value)]` implied by `#[warn(clippy::pedantic)]`
|
this argument is passed by value, but not consumed in the function body:
src/prover/mod.rs#L359
warning: this argument is passed by value, but not consumed in the function body
--> src/prover/mod.rs:359:23
|
359 | deletion_indices: Vec<u32>,
| ^^^^^^^^ help: consider changing the type to: `&[u32]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: `#[warn(clippy::needless_pass_by_value)]` implied by `#[warn(clippy::pedantic)]`
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/prover/mod.rs:47:5
|
47 | / register_histogram!(
48 | | "prover_proving_time",
49 | | "Only the time between sending a request and receiving the proof",
50 | | exponential_buckets(0.1, 1.5, 25).unwrap()
51 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/prover/mod.rs:38:5
|
38 | / register_histogram!(
39 | | "total_proving_time",
40 | | "The time to generate a proof in seconds. Includes preparing the data for the prover",
41 | | exponential_buckets(0.1, 1.5, 25).unwrap()
42 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
docs for function which may panic missing `# Panics` section:
src/identity_tree.rs#L578
warning: docs for function which may panic missing `# Panics` section
--> src/identity_tree.rs:578:5
|
578 | / pub fn new(
579 | | tree_depth: usize,
580 | | dense_prefix_depth: usize,
581 | | flattening_threshold: usize,
... |
584 | | mmap_file_path: &str,
585 | | ) -> Self {
| |_____________^
|
note: first possible panic found here
--> src/identity_tree.rs:591:13
|
591 | / PoseidonTree::<lazy_merkle_tree::Canonical>::new_mmapped_with_dense_prefix_with_init_values(
592 | | tree_depth,
593 | | dense_prefix_depth,
594 | | &initial_leaf,
595 | | initial_leaves_in_dense,
596 | | mmap_file_path
597 | | ).unwrap();
| |______________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/prover/mod.rs:47:5
|
47 | / register_histogram!(
48 | | "prover_proving_time",
49 | | "Only the time between sending a request and receiving the proof",
50 | | exponential_buckets(0.1, 1.5, 25).unwrap()
51 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/prover/mod.rs:38:5
|
38 | / register_histogram!(
39 | | "total_proving_time",
40 | | "The time to generate a proof in seconds. Includes preparing the data for the prover",
41 | | exponential_buckets(0.1, 1.5, 25).unwrap()
42 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
docs for function which may panic missing `# Panics` section:
src/identity_tree.rs#L578
warning: docs for function which may panic missing `# Panics` section
--> src/identity_tree.rs:578:5
|
578 | / pub fn new(
579 | | tree_depth: usize,
580 | | dense_prefix_depth: usize,
581 | | flattening_threshold: usize,
... |
584 | | mmap_file_path: &str,
585 | | ) -> Self {
| |_____________^
|
note: first possible panic found here
--> src/identity_tree.rs:591:13
|
591 | / PoseidonTree::<lazy_merkle_tree::Canonical>::new_mmapped_with_dense_prefix_with_init_values(
592 | | tree_depth,
593 | | dense_prefix_depth,
594 | | &initial_leaf,
595 | | initial_leaves_in_dense,
596 | | mmap_file_path
597 | | ).unwrap();
| |______________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/ethereum/write_oz/openzeppelin.rs:19:5
|
19 | / register_int_counter_vec!("eth_tx_count", "The transaction count by bytes4.", &[
20 | | "bytes4"
21 | | ])
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/ethereum/write_oz/openzeppelin.rs:19:5
|
19 | / register_int_counter_vec!("eth_tx_count", "The transaction count by bytes4.", &[
20 | | "bytes4"
21 | | ])
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/ethereum/read/rpc_logger.rs:20:5
|
20 | / register_histogram!(
21 | | "eth_rpc_latency_seconds",
22 | | "The Ethereum provider latency in seconds."
23 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/ethereum/read/rpc_logger.rs:12:5
|
12 | / register_int_counter_vec!(
13 | | "eth_rpc_requests",
14 | | "Number of Ethereum provider requests made by method.",
15 | | &["method"]
16 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L920
warning: matching over `()` is more explicit
--> src/ethereum/read/rpc_logger.rs:20:5
|
20 | / register_histogram!(
21 | | "eth_rpc_latency_seconds",
22 | | "The Ethereum provider latency in seconds."
23 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: this warning originates in the macro `register_histogram` (in Nightly builds, run with -Z macro-backtrace for more info)
|
matching over `()` is more explicit:
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prometheus-0.13.3/src/macros.rs#L364
warning: matching over `()` is more explicit
--> src/ethereum/read/rpc_logger.rs:12:5
|
12 | / register_int_counter_vec!(
13 | | "eth_rpc_requests",
14 | | "Number of Ethereum provider requests made by method.",
15 | | &["method"]
16 | | )
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`
= note: this warning originates in the macro `__register_counter_vec` which comes from the expansion of the macro `register_int_counter_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
|
variables can be used directly in the `format!` string:
src/database/mod.rs#L676
warning: variables can be used directly in the `format!` string
--> src/database/mod.rs:676:21
|
676 | let query = format!(
| _____________________^
677 | | "DELETE FROM deletions WHERE commitment IN ({})",
678 | | placeholders
679 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
variables can be used directly in the `format!` string:
src/database/mod.rs#L676
warning: variables can be used directly in the `format!` string
--> src/database/mod.rs:676:21
|
676 | let query = format!(
| _____________________^
677 | | "DELETE FROM deletions WHERE commitment IN ({})",
678 | | placeholders
679 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/contracts/mod.rs#L384
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/contracts/mod.rs:384:38
|
384 | let padding_index = 2u32.pow(self.tree_depth as u32);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: `#[warn(clippy::cast_possible_truncation)]` implied by `#[warn(clippy::pedantic)]`
help: ... or use `try_from` and handle the error accordingly
|
384 | let padding_index = 2u32.pow(u32::try_from(self.tree_depth));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
adding items after statements is confusing, since items exist from the start of the scope:
src/contracts/mod.rs#L376
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/contracts/mod.rs:376:9
|
376 | use ethers::abi::AbiDecode;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
= note: `#[warn(clippy::items_after_statements)]` implied by `#[warn(clippy::pedantic)]`
|
casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers:
src/contracts/mod.rs#L384
warning: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
--> src/contracts/mod.rs:384:38
|
384 | let padding_index = 2u32.pow(self.tree_depth as u32);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: `#[warn(clippy::cast_possible_truncation)]` implied by `#[warn(clippy::pedantic)]`
help: ... or use `try_from` and handle the error accordingly
|
384 | let padding_index = 2u32.pow(u32::try_from(self.tree_depth));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
adding items after statements is confusing, since items exist from the start of the scope:
src/contracts/mod.rs#L376
warning: adding items after statements is confusing, since items exist from the start of the scope
--> src/contracts/mod.rs:376:9
|
376 | use ethers::abi::AbiDecode;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
= note: `#[warn(clippy::items_after_statements)]` implied by `#[warn(clippy::pedantic)]`
|
variables can be used directly in the `format!` string:
src/contracts/abi.rs#L28
warning: variables can be used directly in the `format!` string
--> src/contracts/abi.rs:28:18
|
28 | _ => panic!("Invalid value for TreeChangeKind: {}", value),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
help: change this to
|
28 - _ => panic!("Invalid value for TreeChangeKind: {}", value),
28 + _ => panic!("Invalid value for TreeChangeKind: {value}"),
|
|
variables can be used directly in the `format!` string:
src/contracts/abi.rs#L28
warning: variables can be used directly in the `format!` string
--> src/contracts/abi.rs:28:18
|
28 | _ => panic!("Invalid value for TreeChangeKind: {}", value),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
help: change this to
|
28 - _ => panic!("Invalid value for TreeChangeKind: {}", value),
28 + _ => panic!("Invalid value for TreeChangeKind: {value}"),
|
|
this function has too many arguments (8/7):
src/app.rs#L335
warning: this function has too many arguments (8/7)
--> src/app.rs:335:5
|
335 | / async fn get_cached_tree_state(
336 | | database: &Database,
337 | | tree_depth: usize,
338 | | dense_prefix_depth: usize,
... |
343 | | mmap_file_path: &str,
344 | | ) -> anyhow::Result<Option<TreeState>> {
| |__________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
docs for function which may panic missing `# Panics` section:
src/app.rs#L304
warning: docs for function which may panic missing `# Panics` section
--> src/app.rs:304:5
|
304 | / pub fn get_leftover_leaves_and_update_index(
305 | | index: &mut usize,
306 | | dense_prefix_depth: usize,
307 | | mined_items: &Vec<TreeUpdate>,
308 | | ) -> Vec<ruint::Uint<256, 4>> {
| |_________________________________^
|
note: first possible panic found here
--> src/app.rs:312:28
|
312 | let max_leaf = mined_items.last().map(|item| item.leaf_index).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
note: the lint level is defined here
--> src/lib.rs:2:22
|
2 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
|
this function has too many arguments (8/7):
src/app.rs#L253
warning: this function has too many arguments (8/7)
--> src/app.rs:253:5
|
253 | / async fn restore_or_initialize_tree(
254 | | database: &Database,
255 | | tree_depth: usize,
256 | | dense_prefix_depth: usize,
... |
261 | | force_cache_purge: bool,
262 | | ) -> AnyhowResult<TreeState> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
note: the lint level is defined here
--> src/lib.rs:2:9
|
2 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::too_many_arguments)]` implied by `#[warn(clippy::all)]`
|
this function has too many arguments (8/7):
src/app.rs#L335
warning: this function has too many arguments (8/7)
--> src/app.rs:335:5
|
335 | / async fn get_cached_tree_state(
336 | | database: &Database,
337 | | tree_depth: usize,
338 | | dense_prefix_depth: usize,
... |
343 | | mmap_file_path: &str,
344 | | ) -> anyhow::Result<Option<TreeState>> {
| |__________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
docs for function which may panic missing `# Panics` section:
src/app.rs#L304
warning: docs for function which may panic missing `# Panics` section
--> src/app.rs:304:5
|
304 | / pub fn get_leftover_leaves_and_update_index(
305 | | index: &mut usize,
306 | | dense_prefix_depth: usize,
307 | | mined_items: &Vec<TreeUpdate>,
308 | | ) -> Vec<ruint::Uint<256, 4>> {
| |_________________________________^
|
note: first possible panic found here
--> src/app.rs:312:28
|
312 | let max_leaf = mined_items.last().map(|item| item.leaf_index).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
note: the lint level is defined here
--> src/lib.rs:2:22
|
2 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
|
this function has too many arguments (8/7):
src/app.rs#L253
warning: this function has too many arguments (8/7)
--> src/app.rs:253:5
|
253 | / async fn restore_or_initialize_tree(
254 | | database: &Database,
255 | | tree_depth: usize,
256 | | dense_prefix_depth: usize,
... |
261 | | force_cache_purge: bool,
262 | | ) -> AnyhowResult<TreeState> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
note: the lint level is defined here
--> src/lib.rs:2:9
|
2 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::too_many_arguments)]` implied by `#[warn(clippy::all)]`
|