Skip to content

farm position first audit fixes #3592

farm position first audit fixes

farm position first audit fixes #3592

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / clippy failed Sep 18, 2023 in 1s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (8)

dex/farm/src/lib.rs|231 col 63| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> dex/farm/src/lib.rs:231:63
|
231 | let boosted_rewards = self.claim_only_boosted_payment(&user);
| ^^^^^ help: change this to: user
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: #[warn(clippy::needless_borrow)] on by default
dex/farm-with-locked-rewards/src/lib.rs|233 col 9| warning: returning the result of a let binding from a block
--> dex/farm-with-locked-rewards/src/lib.rs:240:9
|
233 | / let locked_rewards_payment = self.send_to_lock_contract_non_zero(
234 | | self.reward_token_id().get(),
235 | | boosted_rewards,
236 | | caller.clone(),
237 | | user.clone(),
238 | | );
| |- unnecessary let binding
239 |
240 | locked_rewards_payment
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: #[warn(clippy::let_and_return)] on by default
help: return the expression directly
|
233 ~
234 |
235 ~ self.send_to_lock_contract_non_zero(
236 + self.reward_token_id().get(),
237 + boosted_rewards,
238 + caller.clone(),
239 + user.clone(),
240 + )
|
dex/farm-with-locked-rewards/src/lib.rs|232 col 63| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> dex/farm-with-locked-rewards/src/lib.rs:232:63
|
232 | let boosted_rewards = self.claim_only_boosted_payment(&user);
| ^^^^^ help: change this to: user
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: #[warn(clippy::needless_borrow)] on by default
farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs|43 col 63| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63
|
43 | let boosted_rewards = self.claim_only_boosted_payment(&user);
| ^^^^^ help: change this to: user
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: #[warn(clippy::needless_borrow)] on by default
dex/farm/src/lib.rs|231 col 63| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> dex/farm/src/lib.rs:231:63
|
231 | let boosted_rewards = self.claim_only_boosted_payment(&user);
| ^^^^^ help: change this to: user
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: #[warn(clippy::needless_borrow)] on by default
dex/farm-with-locked-rewards/src/lib.rs|233 col 9| warning: returning the result of a let binding from a block
--> dex/farm-with-locked-rewards/src/lib.rs:240:9
|
233 | / let locked_rewards_payment = self.send_to_lock_contract_non_zero(
234 | | self.reward_token_id().get(),
235 | | boosted_rewards,
236 | | caller.clone(),
237 | | user.clone(),
238 | | );
| |
- unnecessary let binding
239 |
240 | locked_rewards_payment
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: #[warn(clippy::let_and_return)] on by default
help: return the expression directly
|
233 ~
234 |
235 ~ self.send_to_lock_contract_non_zero(
236 + self.reward_token_id().get(),
237 + boosted_rewards,
238 + caller.clone(),
239 + user.clone(),
240 + )
|
dex/farm-with-locked-rewards/src/lib.rs|232 col 63| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> dex/farm-with-locked-rewards/src/lib.rs:232:63
|
232 | let boosted_rewards = self.claim_only_boosted_payment(&user);
| ^^^^^ help: change this to: user
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: #[warn(clippy::needless_borrow)] on by default
farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs|43 col 63| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63
|
43 | let boosted_rewards = self.claim_only_boosted_payment(&user);
| ^^^^^ help: change this to: user
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: #[warn(clippy::needless_borrow)] on by default

Filtered Findings (6)

dex/farm/src/lib.rs|124 col 83| warning: redundant clone
--> dex/farm/src/lib.rs:124:83
|
124 | let claim_rewards_result = self.claim_rewards::<Wrapper>(orig_caller.clone());
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> dex/farm/src/lib.rs:124:72
|
124 | let claim_rewards_result = self.claim_rewards::<Wrapper>(orig_caller.clone());
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: #[warn(clippy::redundant_clone)] on by default
farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs|43 col 28| warning: redundant clone
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:43:28
|
43 | full_attributes.clone().into_part(&exit_amount);
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:43:13
|
43 | full_attributes.clone().into_part(&exit_amount);
| ^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: #[warn(clippy::redundant_clone)] on by default
farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs|58 col 24| warning: redundant clone
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:58:24
|
58 | orig_caller.clone(),
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:58:13
|
58 | orig_caller.clone(),
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
dex/farm/src/lib.rs|124 col 83| warning: redundant clone
--> dex/farm/src/lib.rs:124:83
|
124 | let claim_rewards_result = self.claim_rewards::<Wrapper>(orig_caller.clone());
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> dex/farm/src/lib.rs:124:72
|
124 | let claim_rewards_result = self.claim_rewards::<Wrapper>(orig_caller.clone());
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: #[warn(clippy::redundant_clone)] on by default
farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs|43 col 28| warning: redundant clone
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:43:28
|
43 | full_attributes.clone().into_part(&exit_amount);
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:43:13
|
43 | full_attributes.clone().into_part(&exit_amount);
| ^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: #[warn(clippy::redundant_clone)] on by default
farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs|58 col 24| warning: redundant clone
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:58:24
|
58 | orig_caller.clone(),
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs:58:13
|
58 | orig_caller.clone(),
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone

Annotations

Check warning on line 231 in dex/farm/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] dex/farm/src/lib.rs#L231

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm/src/lib.rs:231:63
    |
231 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default
Raw output
dex/farm/src/lib.rs:231:63:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm/src/lib.rs:231:63
    |
231 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default


__END__

Check warning on line 233 in dex/farm-with-locked-rewards/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] dex/farm-with-locked-rewards/src/lib.rs#L233

warning: returning the result of a `let` binding from a block
   --> dex/farm-with-locked-rewards/src/lib.rs:240:9
    |
233 | /         let locked_rewards_payment = self.send_to_lock_contract_non_zero(
234 | |             self.reward_token_id().get(),
235 | |             boosted_rewards,
236 | |             caller.clone(),
237 | |             user.clone(),
238 | |         );
    | |__________- unnecessary `let` binding
239 |
240 |           locked_rewards_payment
    |           ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
233 ~         
234 | 
235 ~         self.send_to_lock_contract_non_zero(
236 +             self.reward_token_id().get(),
237 +             boosted_rewards,
238 +             caller.clone(),
239 +             user.clone(),
240 +         )
    |
Raw output
dex/farm-with-locked-rewards/src/lib.rs:233:9:w:warning: returning the result of a `let` binding from a block
   --> dex/farm-with-locked-rewards/src/lib.rs:240:9
    |
233 | /         let locked_rewards_payment = self.send_to_lock_contract_non_zero(
234 | |             self.reward_token_id().get(),
235 | |             boosted_rewards,
236 | |             caller.clone(),
237 | |             user.clone(),
238 | |         );
    | |__________- unnecessary `let` binding
239 |
240 |           locked_rewards_payment
    |           ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
233 ~         
234 | 
235 ~         self.send_to_lock_contract_non_zero(
236 +             self.reward_token_id().get(),
237 +             boosted_rewards,
238 +             caller.clone(),
239 +             user.clone(),
240 +         )
    |


__END__

Check warning on line 232 in dex/farm-with-locked-rewards/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] dex/farm-with-locked-rewards/src/lib.rs#L232

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm-with-locked-rewards/src/lib.rs:232:63
    |
232 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default
Raw output
dex/farm-with-locked-rewards/src/lib.rs:232:63:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm-with-locked-rewards/src/lib.rs:232:63
    |
232 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default


__END__

Check warning on line 43 in farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs#L43

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63
   |
43 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
   |                                                               ^^^^^ help: change this to: `user`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default
Raw output
farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63
   |
43 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
   |                                                               ^^^^^ help: change this to: `user`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default


__END__

Check warning on line 231 in dex/farm/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] dex/farm/src/lib.rs#L231

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm/src/lib.rs:231:63
    |
231 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default
Raw output
dex/farm/src/lib.rs:231:63:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm/src/lib.rs:231:63
    |
231 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default


__END__

Check warning on line 233 in dex/farm-with-locked-rewards/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] dex/farm-with-locked-rewards/src/lib.rs#L233

warning: returning the result of a `let` binding from a block
   --> dex/farm-with-locked-rewards/src/lib.rs:240:9
    |
233 | /         let locked_rewards_payment = self.send_to_lock_contract_non_zero(
234 | |             self.reward_token_id().get(),
235 | |             boosted_rewards,
236 | |             caller.clone(),
237 | |             user.clone(),
238 | |         );
    | |__________- unnecessary `let` binding
239 |
240 |           locked_rewards_payment
    |           ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
233 ~         
234 | 
235 ~         self.send_to_lock_contract_non_zero(
236 +             self.reward_token_id().get(),
237 +             boosted_rewards,
238 +             caller.clone(),
239 +             user.clone(),
240 +         )
    |
Raw output
dex/farm-with-locked-rewards/src/lib.rs:233:9:w:warning: returning the result of a `let` binding from a block
   --> dex/farm-with-locked-rewards/src/lib.rs:240:9
    |
233 | /         let locked_rewards_payment = self.send_to_lock_contract_non_zero(
234 | |             self.reward_token_id().get(),
235 | |             boosted_rewards,
236 | |             caller.clone(),
237 | |             user.clone(),
238 | |         );
    | |__________- unnecessary `let` binding
239 |
240 |           locked_rewards_payment
    |           ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
233 ~         
234 | 
235 ~         self.send_to_lock_contract_non_zero(
236 +             self.reward_token_id().get(),
237 +             boosted_rewards,
238 +             caller.clone(),
239 +             user.clone(),
240 +         )
    |


__END__

Check warning on line 232 in dex/farm-with-locked-rewards/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] dex/farm-with-locked-rewards/src/lib.rs#L232

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm-with-locked-rewards/src/lib.rs:232:63
    |
232 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default
Raw output
dex/farm-with-locked-rewards/src/lib.rs:232:63:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> dex/farm-with-locked-rewards/src/lib.rs:232:63
    |
232 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
    |                                                               ^^^^^ help: change this to: `user`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default


__END__

Check warning on line 43 in farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs#L43

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63
   |
43 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
   |                                                               ^^^^^ help: change this to: `user`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default
Raw output
farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs:43:63
   |
43 |         let boosted_rewards = self.claim_only_boosted_payment(&user);
   |                                                               ^^^^^ help: change this to: `user`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default


__END__