Skip to content

Contracts upgrade 0.54.0 (3) #531

Contracts upgrade 0.54.0 (3)

Contracts upgrade 0.54.0 (3) #531

GitHub Actions / clippy failed Nov 21, 2024 in 0s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (3)

contracts/paymaster/tests/paymaster_blackbox_test.rs|287 col 5| warning: calls to push immediately after creation
--> contracts/paymaster/tests/paymaster_blackbox_test.rs:287:5
|
287 | / let mut payments = Vec::new();
288 | | payments.push(TestEsdtTransfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
289 | | payments.push(TestEsdtTransfer(WEGLD_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
| |^ help: consider using the vec![] macro: let payments = vec![..];
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
= note: #[warn(clippy::vec_init_then_push)] on by default
contracts/paymaster/tests/paymaster_blackbox_test.rs|328 col 5| warning: calls to push immediately after creation
--> contracts/paymaster/tests/paymaster_blackbox_test.rs:328:5
|
328 | / let mut payments = Vec::new();
329 | | payments.push(TestEsdtTransfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
330 | | payments.push(TestEsdtTransfer(WEGLD_TOKEN_ID_EXPR, 0, failling_amount));
| |
_____^ help: consider using the vec![] macro: let payments = vec![..];
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs|38 col 59| warning: useless conversion to the same type: multiversx_sc_scenario::imports::ManagedVec<multiversx_sc_scenario::api::VMHooksApi<multiversx_sc_scenario::api::impl_vh::debug_api::DebugApiBackend>, rewards_distribution::Bracket>
--> contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs:38:59
|
38 | let brackets: ManagedVec<DebugApi, Bracket> = utils::to_brackets(&[
| ___________________________________________________________^
39 | | (10, 2_000),
40 | | (90, 6_000),
41 | | (400, 7_000),
... |
45 | | ])
46 | | .into();
| |___________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: #[warn(clippy::useless_conversion)] on by default
help: consider removing .into()
|
38 ~ let brackets: ManagedVec<DebugApi, Bracket> = utils::to_brackets(&[
39 + (10, 2_000),
40 + (90, 6_000),
41 + (400, 7_000),
42 + (2_500, 10_000),
43 + (25_000, 35_000),
44 + (72_000, 40_000),
45 ~ ]);
|

Filtered Findings (0)

Annotations

Check warning on line 287 in contracts/paymaster/tests/paymaster_blackbox_test.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] contracts/paymaster/tests/paymaster_blackbox_test.rs#L287

warning: calls to `push` immediately after creation
   --> contracts/paymaster/tests/paymaster_blackbox_test.rs:287:5
    |
287 | /     let mut payments = Vec::new();
288 | |     payments.push(TestEsdtTransfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
289 | |     payments.push(TestEsdtTransfer(WEGLD_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
    | |________________________________________________________________________^ help: consider using the `vec![]` macro: `let payments = vec![..];`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
    = note: `#[warn(clippy::vec_init_then_push)]` on by default
Raw output
contracts/paymaster/tests/paymaster_blackbox_test.rs:287:5:w:warning: calls to `push` immediately after creation
   --> contracts/paymaster/tests/paymaster_blackbox_test.rs:287:5
    |
287 | /     let mut payments = Vec::new();
288 | |     payments.push(TestEsdtTransfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
289 | |     payments.push(TestEsdtTransfer(WEGLD_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
    | |________________________________________________________________________^ help: consider using the `vec![]` macro: `let payments = vec![..];`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
    = note: `#[warn(clippy::vec_init_then_push)]` on by default


__END__

Check warning on line 328 in contracts/paymaster/tests/paymaster_blackbox_test.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] contracts/paymaster/tests/paymaster_blackbox_test.rs#L328

warning: calls to `push` immediately after creation
   --> contracts/paymaster/tests/paymaster_blackbox_test.rs:328:5
    |
328 | /     let mut payments = Vec::new();
329 | |     payments.push(TestEsdtTransfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
330 | |     payments.push(TestEsdtTransfer(WEGLD_TOKEN_ID_EXPR, 0, failling_amount));
    | |_____________________________________________________________________________^ help: consider using the `vec![]` macro: `let payments = vec![..];`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
Raw output
contracts/paymaster/tests/paymaster_blackbox_test.rs:328:5:w:warning: calls to `push` immediately after creation
   --> contracts/paymaster/tests/paymaster_blackbox_test.rs:328:5
    |
328 | /     let mut payments = Vec::new();
329 | |     payments.push(TestEsdtTransfer(FEE_TOKEN_ID_EXPR, 0, FEE_AMOUNT));
330 | |     payments.push(TestEsdtTransfer(WEGLD_TOKEN_ID_EXPR, 0, failling_amount));
    | |_____________________________________________________________________________^ help: consider using the `vec![]` macro: `let payments = vec![..];`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push


__END__

Check warning on line 38 in contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs#L38

warning: useless conversion to the same type: `multiversx_sc_scenario::imports::ManagedVec<multiversx_sc_scenario::api::VMHooksApi<multiversx_sc_scenario::api::impl_vh::debug_api::DebugApiBackend>, rewards_distribution::Bracket>`
  --> contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs:38:59
   |
38 |               let brackets: ManagedVec<DebugApi, Bracket> = utils::to_brackets(&[
   |  ___________________________________________________________^
39 | |                 (10, 2_000),
40 | |                 (90, 6_000),
41 | |                 (400, 7_000),
...  |
45 | |             ])
46 | |             .into();
   | |___________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `#[warn(clippy::useless_conversion)]` on by default
help: consider removing `.into()`
   |
38 ~             let brackets: ManagedVec<DebugApi, Bracket> = utils::to_brackets(&[
39 +                 (10, 2_000),
40 +                 (90, 6_000),
41 +                 (400, 7_000),
42 +                 (2_500, 10_000),
43 +                 (25_000, 35_000),
44 +                 (72_000, 40_000),
45 ~             ]);
   |
Raw output
contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs:38:59:w:warning: useless conversion to the same type: `multiversx_sc_scenario::imports::ManagedVec<multiversx_sc_scenario::api::VMHooksApi<multiversx_sc_scenario::api::impl_vh::debug_api::DebugApiBackend>, rewards_distribution::Bracket>`
  --> contracts/rewards-distribution/tests/compute_brackets_whitebox_test.rs:38:59
   |
38 |               let brackets: ManagedVec<DebugApi, Bracket> = utils::to_brackets(&[
   |  ___________________________________________________________^
39 | |                 (10, 2_000),
40 | |                 (90, 6_000),
41 | |                 (400, 7_000),
...  |
45 | |             ])
46 | |             .into();
   | |___________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `#[warn(clippy::useless_conversion)]` on by default
help: consider removing `.into()`
   |
38 ~             let brackets: ManagedVec<DebugApi, Bracket> = utils::to_brackets(&[
39 +                 (10, 2_000),
40 +                 (90, 6_000),
41 +                 (400, 7_000),
42 +                 (2_500, 10_000),
43 +                 (25_000, 35_000),
44 +                 (72_000, 40_000),
45 ~             ]);
   |


__END__