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 156 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:156:9
|
156 | 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 119 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:119:9
|
119 | 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 111 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:111:9
|
111 | 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 92 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:92:9
|
92 | 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 87 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:87:5
|
87 | 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
|
87 - pub fn unstake_ccs<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
87 + pub fn unstake_ccs<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeCCSCtx<'info>>) -> Result<()> {
|
Check warning on line 84 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:84:9
|
84 | 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 82 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:82:5
|
82 | 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
|
82 - pub fn stake_ccs<'key, 'accounts, 'remaining, 'info>(_ctx: Context<'key, 'accounts, 'remaining, 'info, StakeCCSCtx<'info>>, _amount: u64) -> Result<()> {
82 + pub fn stake_ccs<'info>(_ctx: Context<'_, '_, '_, 'info, StakeCCSCtx<'info>>, _amount: u64) -> Result<()> {
|
Check warning on line 78 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:78:5
|
78 | 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
|
78 - pub fn unstake_edition<'key, 'accounts, 'remaining, 'info>(ctx: Context<'key, 'accounts, 'remaining, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
78 + pub fn unstake_edition<'info>(ctx: Context<'_, '_, '_, 'info, UnstakeEditionCtx<'info>>) -> Result<()> {
|
Check warning on line 75 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:75:9
|
75 | 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 73 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:73:5
|
73 | 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
|
73 - pub fn stake_edition<'key, 'accounts, 'remaining, 'info>(_ctx: Context<'key, 'accounts, 'remaining, 'info, StakeEditionCtx<'info>>, _amount: u64) -> Result<()> {
73 + pub fn stake_edition<'info>(_ctx: Context<'_, '_, '_, 'info, StakeEditionCtx<'info>>, _amount: u64) -> Result<()> {
|
Check warning on line 45 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:45:9
|
45 | 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 32 in programs/cardinal-rewards-center/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> programs/cardinal-rewards-center/src/lib.rs:32:9
|
32 | 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`
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<()> {
|