Phase 1 shutdown #84
Phase 1 shutdown #84
clippy
35 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 35 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.69.0 (84c898d65 2023-04-16)
- cargo 1.69.0 (6e9a83356 2023-04-12)
- clippy 0.1.69 (84c898d 2023-04-16)
Annotations
Check warning on line 83 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/lib.rs:83:5
|
83 | pub fn unstake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeCCSCtx<'info>>) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
83 - pub fn unstake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
83 + pub fn unstake_ccs<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
|
Check warning on line 79 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/lib.rs:79:5
|
79 | pub fn stake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
79 - pub fn stake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
79 + pub fn stake_ccs<'info>(ctx: Context<'_, '_, '_, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
|
Check warning on line 75 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/lib.rs:75:5
|
75 | pub fn unstake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
75 - pub fn unstake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
75 + pub fn unstake_edition<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
|
Check warning on line 71 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/lib.rs:71:5
|
71 | pub fn stake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
71 - pub fn stake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
71 + pub fn stake_edition<'info>(ctx: Context<'_, '_, '_, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
|
Check warning on line 80 in programs/cardinal-rewards-center/src/payment/state.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'info
warning: the following explicit lifetimes could be elided: 'info
--> programs/cardinal-rewards-center/src/payment/state.rs:80:1
|
80 | pub fn handle_payment<'info>(payment_amount: u64, payment_mint: Pubkey, payment_shares: &Vec<PaymentShare>, remaining_accounts: &mut Iter<AccountInfo<'info>>) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
80 - pub fn handle_payment<'info>(payment_amount: u64, payment_mint: Pubkey, payment_shares: &Vec<PaymentShare>, remaining_accounts: &mut Iter<AccountInfo<'info>>) -> Result<()> {
80 + pub fn handle_payment(payment_amount: u64, payment_mint: Pubkey, payment_shares: &Vec<PaymentShare>, remaining_accounts: &mut Iter<AccountInfo<'_>>) -> Result<()> {
|
Check warning on line 63 in programs/cardinal-rewards-center/src/payment/state.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'info
warning: the following explicit lifetimes could be elided: 'info
--> programs/cardinal-rewards-center/src/payment/state.rs:63:1
|
63 | pub fn handle_payment_info<'info>(payment_info: Pubkey, remaining_accounts: &mut Iter<AccountInfo<'info>>) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
63 - pub fn handle_payment_info<'info>(payment_info: Pubkey, remaining_accounts: &mut Iter<AccountInfo<'info>>) -> Result<()> {
63 + pub fn handle_payment_info(payment_info: Pubkey, remaining_accounts: &mut Iter<AccountInfo<'_>>) -> Result<()> {
|
Check warning on line 51 in programs/cardinal-rewards-center/src/payment/state.rs
github-actions / clippy
this match could be replaced by its body itself
warning: this match could be replaced by its body itself
--> programs/cardinal-rewards-center/src/payment/state.rs:44:41
|
44 | let default_allowed_payment_infos = match action {
| _________________________________________^
45 | | _ => [
46 | | "382KXQfzC26jbFmLZBmKoZ6eRz53iwGfxXwoGyyyH8po".to_string(), // cardinal-test-wsol
47 | | "HqiCY5NqfHfyhyjheQ4ENo5J2XSQBpeqhNoeESkDWBpU".to_string(), // cardinal-test (native)
... |
50 | | .to_vec(),
51 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding
= note: `#[warn(clippy::match_single_binding)]` on by default
help: consider using the match body instead
|
44 ~ let default_allowed_payment_infos = [
45 + "382KXQfzC26jbFmLZBmKoZ6eRz53iwGfxXwoGyyyH8po".to_string(), // cardinal-test-wsol
46 + "HqiCY5NqfHfyhyjheQ4ENo5J2XSQBpeqhNoeESkDWBpU".to_string(), // cardinal-test (native)
47 + "SdFEeJxn7XxcnYEMNpnoMMSsTfmA1bHfiRdu6qra7zL".to_string(), // cardinal-default 0.002
48 + ]
49 ~ .to_vec();
|
github-actions / clippy
casting to the same type is unnecessary (`u128` -> `u128`)
warning: casting to the same type is unnecessary (`u128` -> `u128`)
--> programs/cardinal-rewards-center/src/reward_distribution/reward_distributor/init_reward_distributor.rs:56:50
|
56 | reward_distributor.reward_duration_seconds = ix.reward_duration_seconds as u128;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ix.reward_duration_seconds`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Check warning on line 53 in programs/cardinal-rewards-center/src/stake_entry/ccs/unstake_ccs.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/stake_entry/ccs/unstake_ccs.rs:53:1
|
53 | pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
53 - pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
53 + pub fn handler<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
|
Check warning on line 57 in programs/cardinal-rewards-center/src/stake_entry/ccs/stake_ccs.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/stake_entry/ccs/stake_ccs.rs:57:1
|
57 | pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
57 - pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
57 + pub fn handler<'info>(ctx: Context<'_, '_, '_, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
|
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/stake_entry/editions/unstake_edition.rs:52:1
|
52 | pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
52 - pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
52 + pub fn handler<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
|
github-actions / clippy
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/cardinal-rewards-center/src/stake_entry/editions/stake_edition.rs:56:1
|
56 | pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
56 - pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
56 + pub fn handler<'info>(ctx: Context<'_, '_, '_, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
|
Check warning on line 147 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ix`
warning: unused variable: `ix`
--> programs/cardinal-rewards-center/src/lib.rs:147:76
|
147 | pub fn init_reward_distributor(ctx: Context<InitRewardDistributorCtx>, ix: InitRewardDistributorIx) -> Result<()> {
| ^^ help: if this is intentional, prefix it with an underscore: `_ix`
Check warning on line 147 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:147:36
|
147 | pub fn init_reward_distributor(ctx: Context<InitRewardDistributorCtx>, ix: InitRewardDistributorIx) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
Check warning on line 111 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ix`
warning: unused variable: `ix`
--> programs/cardinal-rewards-center/src/lib.rs:111:64
|
111 | pub fn boost_stake_entry(ctx: Context<BoostStakeEntryCtx>, ix: BoostStakeEntryIx) -> Result<()> {
| ^^ help: if this is intentional, prefix it with an underscore: `_ix`
Check warning on line 111 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:111:30
|
111 | pub fn boost_stake_entry(ctx: Context<BoostStakeEntryCtx>, ix: BoostStakeEntryIx) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
Check warning on line 104 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ix`
warning: unused variable: `ix`
--> programs/cardinal-rewards-center/src/lib.rs:104:66
|
104 | pub fn init_stake_booster(ctx: Context<InitStakeBoosterCtx>, ix: InitStakeBoosterIx) -> Result<()> {
| ^^ help: if this is intentional, prefix it with an underscore: `_ix`
Check warning on line 104 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:104:31
|
104 | pub fn init_stake_booster(ctx: Context<InitStakeBoosterCtx>, ix: InitStakeBoosterIx) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
Check warning on line 86 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:86:23
|
86 | pub fn stake_pnft(ctx: Context<StakePNFTCtx>) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
Check warning on line 79 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `amount`
warning: unused variable: `amount`
--> programs/cardinal-rewards-center/src/lib.rs:79:128
|
79 | ... 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_amount`
Check warning on line 79 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:79:58
|
79 | pub fn stake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, amount: u6...
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
Check warning on line 71 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `amount`
warning: unused variable: `amount`
--> programs/cardinal-rewards-center/src/lib.rs:71:136
|
71 | ...fo, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_amount`
Check warning on line 71 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:71:62
|
71 | pub fn stake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, am...
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
Check warning on line 42 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `user`
warning: unused variable: `user`
--> programs/cardinal-rewards-center/src/lib.rs:42:51
|
42 | pub fn init_entry(ctx: Context<InitEntryCtx>, user: Pubkey) -> Result<()> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_user`
Check warning on line 42 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unused variable: `ctx`
warning: unused variable: `ctx`
--> programs/cardinal-rewards-center/src/lib.rs:42:23
|
42 | pub fn init_entry(ctx: Context<InitEntryCtx>, user: Pubkey) -> Result<()> {
| ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`