Merge pull request #1032 from multiversx/timestamp-based-exchange-scs #4579
actions.yml
on: push
Contracts
/
Wasm tests
3m 0s
Contracts
/
Interactor tests
Contracts
/
Test Coverage
1m 54s
Contracts
/
Rust tests
1m 24s
Contracts
/
Clippy linter check
39s
Annotations
37 warnings
|
[clippy] common/modules/farm/contexts/src/storage_cache.rs#L44:
common/modules/farm/contexts/src/storage_cache.rs#L44
warning: the following explicit lifetimes could be elided: 'a
--> common/modules/farm/contexts/src/storage_cache.rs:44:6
|
44 | impl<'a, C: FarmContracTraitBounds> Drop for StorageCache<'a, C> {
| ^^ ^^
|
= 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
|
44 - impl<'a, C: FarmContracTraitBounds> Drop for StorageCache<'a, C> {
44 + impl<C: FarmContracTraitBounds> Drop for StorageCache<'_, C> {
|
|
|
[clippy] energy-integration/energy-factory-mock/src/lib.rs#L20:
energy-integration/energy-factory-mock/src/lib.rs#L20
warning: the borrowed expression implements the required traits
--> energy-integration/energy-factory-mock/src/lib.rs:20:37
|
20 | self.user_energy(&user).set(&Energy::new(
| _____________________________________^
21 | | BigInt::from(energy_amount),
22 | | current_epoch,
23 | | total_locked_tokens,
24 | | ));
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
20 ~ self.user_energy(&user).set(Energy::new(
21 + BigInt::from(energy_amount),
22 + current_epoch,
23 + total_locked_tokens,
24 ~ ));
|
|
|
[clippy] energy-integration/governance-v2/src/configurable.rs#L33:
energy-integration/governance-v2/src/configurable.rs#L33
warning: empty line after doc comment
--> energy-integration/governance-v2/src/configurable.rs:31:1
|
31 | / ///
32 | |
| |_^
33 | const MIN_VOTING_DELAY: u64 = 1;
| ---------------------- the comment documents this constant item
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
= help: if the empty line is unintentional, remove it
|
|
[clippy] energy-integration/governance-v2/src/configurable.rs#L33:
energy-integration/governance-v2/src/configurable.rs#L33
warning: empty line after doc comment
--> energy-integration/governance-v2/src/configurable.rs:31:1
|
31 | / ///
32 | |
| |_^
33 | const MIN_VOTING_DELAY: u64 = 1;
| ---------------------- the comment documents this constant item
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
= help: if the empty line is unintentional, remove it
|
|
[clippy] energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L85:
energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L85
warning: the borrowed expression implements the required traits
--> energy-integration/governance-v2/tests/gov_test_setup/mod.rs:85:26
|
85 | .set(&Energy::new(
| __________________________^
86 | | BigInt::from(managed_biguint!(USER_ENERGY)),
87 | | 0,
88 | | managed_biguint!(0),
89 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
85 ~ .set(Energy::new(
86 + BigInt::from(managed_biguint!(USER_ENERGY)),
87 + 0,
88 + managed_biguint!(0),
89 ~ ));
|
|
|
[clippy] energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L91:
energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L91
warning: the borrowed expression implements the required traits
--> energy-integration/governance-v2/tests/gov_test_setup/mod.rs:91:26
|
91 | .set(&Energy::new(
| __________________________^
92 | | BigInt::from(managed_biguint!(USER_ENERGY)),
93 | | 0,
94 | | managed_biguint!(0),
95 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
|
91 ~ .set(Energy::new(
92 + BigInt::from(managed_biguint!(USER_ENERGY)),
93 + 0,
94 + managed_biguint!(0),
95 ~ ));
|
|
|
[clippy] energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L97:
energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L97
warning: the borrowed expression implements the required traits
--> energy-integration/governance-v2/tests/gov_test_setup/mod.rs:97:26
|
97 | .set(&Energy::new(
| __________________________^
98 | | BigInt::from(managed_biguint!(USER_ENERGY + 210_000)),
99 | | 0,
100 | | managed_biguint!(0),
101 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
|
97 ~ .set(Energy::new(
98 + BigInt::from(managed_biguint!(USER_ENERGY + 210_000)),
99 + 0,
100 + managed_biguint!(0),
101 ~ ));
|
|
|
[clippy] energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L103:
energy-integration/governance-v2/tests/gov_test_setup/mod.rs#L103
warning: the borrowed expression implements the required traits
--> energy-integration/governance-v2/tests/gov_test_setup/mod.rs:103:26
|
103 | .set(&Energy::new(
| __________________________^
104 | | BigInt::from(managed_biguint!(0)),
105 | | 0,
106 | | managed_biguint!(0),
107 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
|
103 ~ .set(Energy::new(
104 + BigInt::from(managed_biguint!(0)),
105 + 0,
106 + managed_biguint!(0),
107 ~ ));
|
|
|
[clippy] energy-integration/energy-factory-mock/src/lib.rs#L20:
energy-integration/energy-factory-mock/src/lib.rs#L20
warning: the borrowed expression implements the required traits
--> energy-integration/energy-factory-mock/src/lib.rs:20:37
|
20 | self.user_energy(&user).set(&Energy::new(
| _____________________________________^
21 | | BigInt::from(energy_amount),
22 | | current_epoch,
23 | | total_locked_tokens,
24 | | ));
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
20 ~ self.user_energy(&user).set(Energy::new(
21 + BigInt::from(energy_amount),
22 + current_epoch,
23 + total_locked_tokens,
24 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs#L277:
dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs#L277
warning: the borrowed expression implements the required traits
--> dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs:277:65
|
277 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
278 | | BigInt::from(managed_biguint!(energy)),
279 | | last_update_epoch,
280 | | managed_biguint!(locked_tokens),
281 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
277 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
278 + BigInt::from(managed_biguint!(energy)),
279 + last_update_epoch,
280 + managed_biguint!(locked_tokens),
281 ~ ));
|
|
|
[clippy] farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs#L98:
farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs#L98
warning: returning the result of a `let` binding from a block
--> farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs:104:9
|
98 | / let output_payments = StakeProxyResult {
99 | | dual_yield_tokens: new_dual_yield_tokens,
100 | | staking_boosted_rewards: staking_farm_enter_result.boosted_rewards,
101 | | lp_farm_boosted_rewards,
102 | | };
| |__________- unnecessary `let` binding
103 |
104 | output_payments
| ^^^^^^^^^^^^^^^
|
= 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
|
98 ~
99 |
100 ~ StakeProxyResult {
101 + dual_yield_tokens: new_dual_yield_tokens,
102 + staking_boosted_rewards: staking_farm_enter_result.boosted_rewards,
103 + lp_farm_boosted_rewards,
104 + }
|
|
|
[clippy] farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs#L747:
farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs#L747
warning: the borrowed expression implements the required traits
--> farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs:747:65
|
747 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
748 | | BigInt::from(managed_biguint!(energy)),
749 | | last_update_epoch,
750 | | managed_biguint!(locked_tokens),
751 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
747 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
748 + BigInt::from(managed_biguint!(energy)),
749 + last_update_epoch,
750 + managed_biguint!(locked_tokens),
751 ~ ));
|
|
|
[clippy] farm-staking/farm-staking/tests/farm_staking_setup/mod.rs#L779:
farm-staking/farm-staking/tests/farm_staking_setup/mod.rs#L779
warning: the borrowed expression implements the required traits
--> farm-staking/farm-staking/tests/farm_staking_setup/mod.rs:779:65
|
779 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
780 | | BigInt::from(managed_biguint!(energy)),
781 | | last_update_epoch,
782 | | managed_biguint!(locked_tokens),
783 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
779 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
780 + BigInt::from(managed_biguint!(energy)),
781 + last_update_epoch,
782 + managed_biguint!(locked_tokens),
783 ~ ));
|
|
|
[clippy] farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs#L98:
farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs#L98
warning: returning the result of a `let` binding from a block
--> farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs:104:9
|
98 | / let output_payments = StakeProxyResult {
99 | | dual_yield_tokens: new_dual_yield_tokens,
100 | | staking_boosted_rewards: staking_farm_enter_result.boosted_rewards,
101 | | lp_farm_boosted_rewards,
102 | | };
| |__________- unnecessary `let` binding
103 |
104 | output_payments
| ^^^^^^^^^^^^^^^
|
= 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
|
98 ~
99 |
100 ~ StakeProxyResult {
101 + dual_yield_tokens: new_dual_yield_tokens,
102 + staking_boosted_rewards: staking_farm_enter_result.boosted_rewards,
103 + lp_farm_boosted_rewards,
104 + }
|
|
|
[clippy] farm-staking/farm-staking/tests/farm_staking_setup/mod.rs#L779:
farm-staking/farm-staking/tests/farm_staking_setup/mod.rs#L779
warning: the borrowed expression implements the required traits
--> farm-staking/farm-staking/tests/farm_staking_setup/mod.rs:779:65
|
779 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
780 | | BigInt::from(managed_biguint!(energy)),
781 | | last_update_epoch,
782 | | managed_biguint!(locked_tokens),
783 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
779 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
780 + BigInt::from(managed_biguint!(energy)),
781 + last_update_epoch,
782 + managed_biguint!(locked_tokens),
783 ~ ));
|
|
|
[clippy] farm-staking/farm-staking/tests/farm_staking_test.rs#L185:
farm-staking/farm-staking/tests/farm_staking_test.rs#L185
warning: manually reimplementing `div_ceil`
--> farm-staking/farm-staking/tests/farm_staking_test.rs:185:37
|
185 | let expected_reward_per_share = (first_reward_share * farm_in_amount
| _____________________________________^
186 | | + second_reward_share * second_farm_in_amount
187 | | + total_amount
188 | | - 1)
189 | | / total_amount;
| |______________________^ help: consider using `.div_ceil()`: `(first_reward_share * farm_in_amount + second_reward_share * second_farm_in_amount).div_ceil(total_amount)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
= note: `#[warn(clippy::manual_div_ceil)]` on by default
|
|
[clippy] farm-staking/farm-staking/tests/farm_staking_setup/mod.rs#L779:
farm-staking/farm-staking/tests/farm_staking_setup/mod.rs#L779
warning: the borrowed expression implements the required traits
--> farm-staking/farm-staking/tests/farm_staking_setup/mod.rs:779:65
|
779 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
780 | | BigInt::from(managed_biguint!(energy)),
781 | | last_update_epoch,
782 | | managed_biguint!(locked_tokens),
783 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
779 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
780 + BigInt::from(managed_biguint!(energy)),
781 + last_update_epoch,
782 + managed_biguint!(locked_tokens),
783 ~ ));
|
|
|
[clippy] dex/fuzz/src/fuzz_farm.rs#L65:
dex/fuzz/src/fuzz_farm.rs#L65
warning: unnecessary use of `get(&caller.address).is_some()`
--> dex/fuzz/src/fuzz_farm.rs:65:59
|
65 | if merge_farm_positions && farm_setup.farmer_info.get(&caller.address).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&caller.address)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
= note: `#[warn(clippy::unnecessary_get_then_check)]` on by default
|
|
[clippy] dex/fuzz/src/fuzz_farm.rs#L225:
dex/fuzz/src/fuzz_farm.rs#L225
warning: unnecessary use of `get(&caller.address).is_some()`
--> dex/fuzz/src/fuzz_farm.rs:225:35
|
225 | if farm_setup.farmer_info.get(&caller.address).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&caller.address)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
|
|
[clippy] dex/fuzz/src/fuzz_farm.rs#L324:
dex/fuzz/src/fuzz_farm.rs#L324
warning: unnecessary use of `get(&caller.address).is_some()`
--> dex/fuzz/src/fuzz_farm.rs:324:35
|
324 | if farm_setup.farmer_info.get(&caller.address).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&caller.address)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290:
dex/farm/tests/farm_setup/multi_user_farm_setup.rs#L290
warning: the borrowed expression implements the required traits
--> dex/farm/tests/farm_setup/multi_user_farm_setup.rs:290:65
|
290 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
291 | | BigInt::from(managed_biguint!(energy)),
292 | | last_update_epoch,
293 | | managed_biguint!(locked_tokens),
294 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
290 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
291 + BigInt::from(managed_biguint!(energy)),
292 + last_update_epoch,
293 + managed_biguint!(locked_tokens),
294 ~ ));
|
|
|
[clippy] dex/farm/tests/farm_single_user_test.rs#L139:
dex/farm/tests/farm_single_user_test.rs#L139
warning: manually reimplementing `div_ceil`
--> dex/farm/tests/farm_single_user_test.rs:139:37
|
139 | let expected_reward_per_share = (first_reward_share * farm_in_amount
| _____________________________________^
140 | | + second_reward_share * second_farm_in_amount
141 | | + total_amount
142 | | - 1)
143 | | / total_amount;
| |______________________^ help: consider using `.div_ceil()`: `(first_reward_share * farm_in_amount + second_reward_share * second_farm_in_amount).div_ceil(total_amount)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
= note: `#[warn(clippy::manual_div_ceil)]` on by default
|
|
[clippy] dex/farm/tests/farm_single_user_test.rs#L179:
dex/farm/tests/farm_single_user_test.rs#L179
warning: manually reimplementing `div_ceil`
--> dex/farm/tests/farm_single_user_test.rs:179:33
|
179 | let prev_reward_per_share = (first_reward_share * farm_in_amount
| _________________________________^
180 | | + second_reward_share * second_farm_in_amount
181 | | + total_farm_token
182 | | - 1)
183 | | / total_farm_token;
| |__________________________^ help: consider using `.div_ceil()`: `(first_reward_share * farm_in_amount + second_reward_share * second_farm_in_amount).div_ceil(total_farm_token)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
|
|
[clippy] energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs#L286:
energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs#L286
warning: the borrowed expression implements the required traits
--> energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs:286:65
|
286 | sc.user_energy(&managed_address!(user)).set(&Energy::new(
| _________________________________________________________________^
287 | | BigInt::from(managed_biguint!(energy_amount)),
288 | | current_epoch,
289 | | managed_biguint!(total_locked_tokens),
290 | | ));
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
286 ~ sc.user_energy(&managed_address!(user)).set(Energy::new(
287 + BigInt::from(managed_biguint!(energy_amount)),
288 + current_epoch,
289 + managed_biguint!(total_locked_tokens),
290 ~ ));
|
|
|
[clippy] dex/pair/tests/pair_rs_test.rs#L1596:
dex/pair/tests/pair_rs_test.rs#L1596
warning: useless use of `vec!`
--> dex/pair/tests/pair_rs_test.rs:1596:21
|
1596 | let transfers = vec![
| _____________________^
1597 | | TxTokenTransfer {
1598 | | token_identifier: LOCKED_TOKEN_ID.to_vec(),
1599 | | nonce: 1,
... |
1606 | | },
1607 | | ];
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
= note: `#[warn(clippy::useless_vec)]` on by default
help: you can use an array directly
|
1596 ~ let transfers = [TxTokenTransfer {
1597 + token_identifier: LOCKED_TOKEN_ID.to_vec(),
1598 + nonce: 1,
1599 + value: rust_biguint!(500_000),
1600 + },
1601 + TxTokenTransfer {
1602 + token_identifier: MEX_TOKEN_ID.to_vec(),
1603 + nonce: 0,
1604 + value: rust_biguint!(500_000),
1605 ~ }];
|
|
|
[clippy] dex/governance/tests/gov_tests.rs#L183:
dex/governance/tests/gov_tests.rs#L183
warning: allocating a new `String` only to create a temporary `&str` from it
--> dex/governance/tests/gov_tests.rs:183:28
|
183 | .assert_user_error(&String::from_utf8(UNREGISTERED_TOKEN_ID.to_vec()).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
help: convert from `&[u8]` to `&str` directly
|
183 - .assert_user_error(&String::from_utf8(UNREGISTERED_TOKEN_ID.to_vec()).unwrap());
183 + .assert_user_error(core::str::from_utf8(UNREGISTERED_TOKEN_ID).unwrap());
|
|
|
[clippy] dex/governance/tests/gov_tests.rs#L205:
dex/governance/tests/gov_tests.rs#L205
warning: allocating a new `String` only to create a temporary `&str` from it
--> dex/governance/tests/gov_tests.rs:205:28
|
205 | .assert_user_error(&String::from_utf8(NOT_ENOUGH_FUNDS_TO_PROPOSE.to_vec()).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
help: convert from `&[u8]` to `&str` directly
|
205 - .assert_user_error(&String::from_utf8(NOT_ENOUGH_FUNDS_TO_PROPOSE.to_vec()).unwrap());
205 + .assert_user_error(core::str::from_utf8(NOT_ENOUGH_FUNDS_TO_PROPOSE).unwrap());
|
|
|
[clippy] dex/governance/tests/gov_tests.rs#L423:
dex/governance/tests/gov_tests.rs#L423
warning: allocating a new `String` only to create a temporary `&str` from it
--> dex/governance/tests/gov_tests.rs:423:28
|
423 | .assert_user_error(&String::from_utf8(VOTING_PERIOD_NOT_ENDED.to_vec()).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
help: convert from `&[u8]` to `&str` directly
|
423 - .assert_user_error(&String::from_utf8(VOTING_PERIOD_NOT_ENDED.to_vec()).unwrap());
423 + .assert_user_error(core::str::from_utf8(VOTING_PERIOD_NOT_ENDED).unwrap());
|
|
|
[clippy] dex/governance/tests/gov_tests.rs#L500:
dex/governance/tests/gov_tests.rs#L500
warning: allocating a new `String` only to create a temporary `&str` from it
--> dex/governance/tests/gov_tests.rs:500:28
|
500 | .assert_user_error(&String::from_utf8(PROPOSAL_NOT_ACTIVE.to_vec()).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
help: convert from `&[u8]` to `&str` directly
|
500 - .assert_user_error(&String::from_utf8(PROPOSAL_NOT_ACTIVE.to_vec()).unwrap());
500 + .assert_user_error(core::str::from_utf8(PROPOSAL_NOT_ACTIVE).unwrap());
|
|
|
[clippy] dex/governance/tests/gov_tests.rs#L570:
dex/governance/tests/gov_tests.rs#L570
warning: allocating a new `String` only to create a temporary `&str` from it
--> dex/governance/tests/gov_tests.rs:570:28
|
570 | .assert_user_error(&String::from_utf8(VOTING_PERIOD_NOT_ENDED.to_vec()).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
help: convert from `&[u8]` to `&str` directly
|
570 - .assert_user_error(&String::from_utf8(VOTING_PERIOD_NOT_ENDED.to_vec()).unwrap());
570 + .assert_user_error(core::str::from_utf8(VOTING_PERIOD_NOT_ENDED).unwrap());
|
|
|
[clippy] common/modules/farm/contexts/src/storage_cache.rs#L44:
common/modules/farm/contexts/src/storage_cache.rs#L44
warning: the following explicit lifetimes could be elided: 'a
--> common/modules/farm/contexts/src/storage_cache.rs:44:6
|
44 | impl<'a, C: FarmContracTraitBounds> Drop for StorageCache<'a, C> {
| ^^ ^^
|
= 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
|
44 - impl<'a, C: FarmContracTraitBounds> Drop for StorageCache<'a, C> {
44 + impl<C: FarmContracTraitBounds> Drop for StorageCache<'_, C> {
|
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
coverage
|
4.97 KB |
sha256:a6082987adb2fd961a869312658e0d2518ebd4ef4fd816cbc21a26d87d80c730
|
|
|
report
|
702 Bytes |
sha256:f73205a02120b03167074e26e2c1ccea1b03cd78aa66d56fa77d8d4326023034
|
|