fix nit #180
Annotations
1 error and 14 warnings
site
Process completed with exit code 134.
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/lib.rs#L78
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-rewards-center/src/lib.rs:78:5
|
78 | 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
|
78 - pub fn unstake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
78 + pub fn unstake_ccs<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
|
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/lib.rs#L75
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-rewards-center/src/lib.rs:75:5
|
75 | 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
|
75 - pub fn stake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
75 + pub fn stake_ccs<'info>(ctx: Context<'_, '_, '_, 'info, StakeCCSCtx<'info>>, amount: u64) -> Result<()> {
|
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/lib.rs#L71
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-rewards-center/src/lib.rs:71:5
|
71 | 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
|
71 - pub fn unstake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
71 + pub fn unstake_edition<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
|
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/lib.rs#L68
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-rewards-center/src/lib.rs:68:5
|
68 | 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
|
68 - pub fn stake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
68 + pub fn stake_edition<'info>(ctx: Context<'_, '_, '_, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
|
|
the following explicit lifetimes could be elided: 'info:
programs/solana-nft-programs-rewards-center/src/payment/state.rs#L78
warning: the following explicit lifetimes could be elided: 'info
--> programs/solana-nft-programs-rewards-center/src/payment/state.rs:78:1
|
78 | 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
|
78 - pub fn handle_payment<'info>(payment_amount: u64, payment_mint: Pubkey, payment_shares: &Vec<PaymentShare>, remaining_accounts: &mut Iter<AccountInfo<'info>>) -> Result<()> {
78 + pub fn handle_payment(payment_amount: u64, payment_mint: Pubkey, payment_shares: &Vec<PaymentShare>, remaining_accounts: &mut Iter<AccountInfo<'_>>) -> Result<()> {
|
|
the following explicit lifetimes could be elided: 'info:
programs/solana-nft-programs-rewards-center/src/payment/state.rs#L61
warning: the following explicit lifetimes could be elided: 'info
--> programs/solana-nft-programs-rewards-center/src/payment/state.rs:61:1
|
61 | 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
|
61 - pub fn handle_payment_info<'info>(payment_info: Pubkey, remaining_accounts: &mut Iter<AccountInfo<'info>>) -> Result<()> {
61 + pub fn handle_payment_info(payment_info: Pubkey, remaining_accounts: &mut Iter<AccountInfo<'_>>) -> Result<()> {
|
|
this match could be replaced by its body itself:
programs/solana-nft-programs-rewards-center/src/payment/state.rs#L52
warning: this match could be replaced by its body itself
--> programs/solana-nft-programs-rewards-center/src/payment/state.rs:52:33
|
52 | let allowed_payment_infos = match (stake_pool.key().to_string().as_str(), action) {
| _________________________________^
53 | | _ => default_allowed_payment_infos,
54 | | };
| |_____^ help: consider using the match body instead: `default_allowed_payment_infos`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding
|
this match could be replaced by its body itself:
programs/solana-nft-programs-rewards-center/src/payment/state.rs#L44
warning: this match could be replaced by its body itself
--> programs/solana-nft-programs-rewards-center/src/payment/state.rs:44:41
|
44 | let default_allowed_payment_infos = match action {
| _________________________________________^
45 | | _ => [
46 | | "382KXQfzC26jbFmLZBmKoZ6eRz53iwGfxXwoGyyyH8po".to_string(), // test-wsol
47 | | "HqiCY5NqfHfyhyjheQ4ENo5J2XSQBpeqhNoeESkDWBpU".to_string(), // 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(), // test-wsol
46 + "HqiCY5NqfHfyhyjheQ4ENo5J2XSQBpeqhNoeESkDWBpU".to_string(), // test (native)
47 + "SdFEeJxn7XxcnYEMNpnoMMSsTfmA1bHfiRdu6qra7zL".to_string(), // default 0.002
48 + ]
49 ~ .to_vec();
|
|
casting to the same type is unnecessary (`u128` -> `u128`):
programs/solana-nft-programs-rewards-center/src/reward_distribution/reward_distributor/init_reward_distributor.rs#L56
warning: casting to the same type is unnecessary (`u128` -> `u128`)
--> programs/solana-nft-programs-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
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/stake_entry/ccs/unstake_ccs.rs#L53
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-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<()> {
|
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/stake_entry/ccs/stake_ccs.rs#L57
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-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<()> {
|
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/stake_entry/editions/unstake_edition.rs#L51
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-rewards-center/src/stake_entry/editions/unstake_edition.rs:51:1
|
51 | 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
|
51 - pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
51 + pub fn handler<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
|
|
the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining:
programs/solana-nft-programs-rewards-center/src/stake_entry/editions/stake_edition.rs#L55
warning: the following explicit lifetimes could be elided: 'key, 'accounts, 'remaining
--> programs/solana-nft-programs-rewards-center/src/stake_entry/editions/stake_edition.rs:55:1
|
55 | 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
|
55 - pub fn handler<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
55 + pub fn handler<'info>(ctx: Context<'_, '_, '_, 'info, StakeEditionCtx<'info>>, amount: u64) -> Result<()> {
|
|
site
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|