Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy: zk-token-sdk lints #34633

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Jan 3, 2024

Problem

There are new nightly clippy lints in the zk-token-sdk crate. Refer to #34626 for more information.

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:62:22
   |
62 |         commitments: &Vec<&PedersenCommitment>,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[&PedersenCommitment]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
   = note: `#[warn(clippy::ptr_arg)]` on by default

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:63:18
   |
63 |         amounts: &Vec<u64>,
   |                  ^^^^^^^^^ help: change this to: `&[u64]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:64:22
   |
64 |         bit_lengths: &Vec<usize>,
   |                      ^^^^^^^^^^^ help: change this to: `&[usize]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:65:19
   |
65 |         openings: &Vec<&PedersenOpening>,
   |                   ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[&PedersenOpening]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

    Checking solana-clap-utils v1.18.0 (/Users/brooks/src/solana/clap-utils)
warning: `solana-zk-token-sdk` (lib) generated 4 warnings

Summary of Changes

Fix 'em.

```
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:62:22
   |
62 |         commitments: &Vec<&PedersenCommitment>,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[&PedersenCommitment]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
   = note: `#[warn(clippy::ptr_arg)]` on by default

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:63:18
   |
63 |         amounts: &Vec<u64>,
   |                  ^^^^^^^^^ help: change this to: `&[u64]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:64:22
   |
64 |         bit_lengths: &Vec<usize>,
   |                      ^^^^^^^^^^^ help: change this to: `&[usize]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> zk-token-sdk/src/instruction/batched_range_proof/mod.rs:65:19
   |
65 |         openings: &Vec<&PedersenOpening>,
   |                   ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[&PedersenOpening]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

    Checking solana-clap-utils v1.18.0 (/Users/brooks/src/solana/clap-utils)
warning: `solana-zk-token-sdk` (lib) generated 4 warnings
```
@brooksprumo brooksprumo self-assigned this Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (09a94b8) 81.8% compared to head (c77887d) 81.8%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34633     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         824      824             
  Lines      222260   222260             
=========================================
- Hits       181893   181888      -5     
- Misses      40367    40372      +5     

@brooksprumo brooksprumo marked this pull request as ready for review January 3, 2024 02:41
@brooksprumo brooksprumo added the automerge Merge this Pull Request automatically once CI passes label Jan 3, 2024
Copy link
Contributor

@samkim-crypto samkim-crypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@brooksprumo brooksprumo merged commit 59dd007 into solana-labs:master Jan 3, 2024
36 checks passed
@brooksprumo brooksprumo deleted the clippy/zk-token branch January 3, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants