Skip to content

throw errors in relevant instructions

Giannis Chatziveroglou f14998f
Sign in for the full log view
GitHub Actions / clippy succeeded Jul 16, 2023 in 1s

clippy

20 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 20
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 78 in programs/cardinal-rewards-center/src/lib.rs

See this annotation in the file changed.

@github-actions 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: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<()> {
   |

Check warning on line 75 in programs/cardinal-rewards-center/src/lib.rs

See this annotation in the file changed.

@github-actions 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 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<()> {
   |

Check warning on line 71 in programs/cardinal-rewards-center/src/lib.rs

See this annotation in the file changed.

@github-actions 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 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<()> {
   |

Check warning on line 68 in programs/cardinal-rewards-center/src/lib.rs

See this annotation in the file changed.

@github-actions 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: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<()> {
   |

Check warning on line 80 in programs/cardinal-rewards-center/src/payment/state.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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();
   |

Check warning on line 73 in programs/cardinal-rewards-center/src/stake_booster/boost_stake_entry.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> programs/cardinal-rewards-center/src/stake_booster/boost_stake_entry.rs:73:5
   |
73 |     return Err(error!(ErrorCode::ProtocolsShutdown));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = help: remove `return`

Check warning on line 58 in programs/cardinal-rewards-center/src/stake_booster/init_stake_booster.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> programs/cardinal-rewards-center/src/stake_booster/init_stake_booster.rs:58:5
   |
58 |     return Err(error!(ErrorCode::ProtocolsShutdown));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = help: remove `return`

Check warning on line 56 in programs/cardinal-rewards-center/src/reward_distribution/reward_distributor/init_reward_distributor.rs

See this annotation in the file changed.

@github-actions 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 65 in programs/cardinal-rewards-center/src/reward_distribution/reward_distributor/init_reward_distributor.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> programs/cardinal-rewards-center/src/reward_distribution/reward_distributor/init_reward_distributor.rs:65:5
   |
65 |     return Err(error!(ErrorCode::ProtocolsShutdown));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = help: remove `return`

Check warning on line 186 in programs/cardinal-rewards-center/src/stake_entry/pnfts/stake_pnft.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> programs/cardinal-rewards-center/src/stake_entry/pnfts/stake_pnft.rs:186:5
    |
186 |     return Err(error!(ErrorCode::ProtocolsShutdown));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = help: remove `return`

Check warning on line 53 in programs/cardinal-rewards-center/src/stake_entry/ccs/unstake_ccs.rs

See this annotation in the file changed.

@github-actions 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 113 in programs/cardinal-rewards-center/src/stake_entry/ccs/stake_ccs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> programs/cardinal-rewards-center/src/stake_entry/ccs/stake_ccs.rs:113:5
    |
113 |     return Err(error!(ErrorCode::ProtocolsShutdown));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = help: remove `return`

Check warning on line 57 in programs/cardinal-rewards-center/src/stake_entry/ccs/stake_ccs.rs

See this annotation in the file changed.

@github-actions 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<()> {
   |

Check warning on line 52 in programs/cardinal-rewards-center/src/stake_entry/editions/unstake_edition.rs

See this annotation in the file changed.

@github-actions 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<()> {
   |

Check warning on line 116 in programs/cardinal-rewards-center/src/stake_entry/editions/stake_edition.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> programs/cardinal-rewards-center/src/stake_entry/editions/stake_edition.rs:116:5
    |
116 |     return Err(error!(ErrorCode::ProtocolsShutdown));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = help: remove `return`

Check warning on line 56 in programs/cardinal-rewards-center/src/stake_entry/editions/stake_edition.rs

See this annotation in the file changed.

@github-actions 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 47 in programs/cardinal-rewards-center/src/stake_entry/init_entry.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> programs/cardinal-rewards-center/src/stake_entry/init_entry.rs:47:5
   |
47 |     return Err(error!(ErrorCode::ProtocolsShutdown));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = help: remove `return`

Check warning on line 77 in programs/cardinal-rewards-center/src/stake_pool/init_pool.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> programs/cardinal-rewards-center/src/stake_pool/init_pool.rs:77:5
   |
77 |     return Err(error!(ErrorCode::ProtocolsShutdown));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = note: `#[warn(clippy::needless_return)]` on by default
   = help: remove `return`