Composable tasks to perform complex actions #27
reviewdog [clippy] report
reported by reviewdog 🐶
Findings (12)
contracts/proxy-actions/src/structs.rs|51 col 17| warning: unused variable: payment_to_next_task
--> contracts/proxy-actions/src/structs.rs:51:17
|
51 | let payment_to_next_task = self
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _payment_to_next_task
|
= note: #[warn(unused_variables)]
on by default
contracts/proxy-actions/src/structs.rs|77 col 17| warning: unused variable: payment_to_next_task
--> contracts/proxy-actions/src/structs.rs:77:17
|
77 | let payment_to_next_task = match task_type {
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _payment_to_next_task
contracts/proxy-actions/src/structs.rs|46 col 43| warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:46:43
|
46 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:46:36
|
46 | let payment_to_next_task = payment.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
contracts/proxy-actions/src/structs.rs|51 col 13| warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:51:13
|
51 | / let payment_to_next_task = self
52 | | .send()
53 | | .contract_call::(dest_addr, endpoint_name)
54 | | .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 | | .with_raw_arguments(endpoint_args.to_arg_buffer())
56 | | .with_gas_limit(gas_limit)
57 | | .transfer_execute();
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: #[warn(clippy::let_unit_value)]
on by default
help: omit the let
binding
|
51 ~ self
52 + .send()
53 + .contract_call::(dest_addr, endpoint_name)
54 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 + .with_raw_arguments(endpoint_args.to_arg_buffer())
56 + .with_gas_limit(gas_limit)
57 + .transfer_execute();
|
contracts/proxy-actions/src/structs.rs|72 col 43| warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:72:43
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:72:36
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
contracts/proxy-actions/src/structs.rs|77 col 13| warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:77:13
|
77 | / let payment_to_next_task = match task_type {
78 | | TaskType::WrapEGLD => {
79 | | //TODO
80 | | }
... |
117 | | }
118 | | };
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the let
binding
|
77 ~ match task_type {
78 + TaskType::WrapEGLD => {
79 + //TODO
80 + }
81 + TaskType::UnwrapEgld => {
82 + //TODO
83 + }
84 + TaskType::Swap => {
85 + let args = endpoint_args.into_vec_of_buffers();
86 + let token_out = TokenIdentifier::from(args.get(0).clone_value());
87 + let min_amount_out = BigUint::from(args.get(1).clone_value());
88 + let token_payment = payment_to_next_task
89 + .token_identifier
90 + .clone()
91 + .into_esdt_option();
92 + if token_payment.is_none() {
93 + return;
94 + }
95 + self.pair_contract_proxy(dest_addr)
96 + .swap_tokens_fixed_input(token_out, min_amount_out)
97 + .with_esdt_transfer(EsdtTokenPayment::new(
98 + token_payment.unwrap(),
99 + payment_to_next_task.token_nonce,
100 + payment_to_next_task.amount.clone(),
101 + ))
102 + .with_gas_limit(gas_limit)
103 + .transfer_execute();
104 + }
105 + TaskType::SendEsdt => {
106 + self.send()
107 + .contract_call::(dest_addr, b"".into())
108 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
109 + .with_gas_limit(gas_limit)
110 + .transfer_execute();
111 + }
112 + TaskType::ExitLP => {
113 + //TODO
114 + }
115 + TaskType::None => {
116 + // return Ok(())
117 + }
118 + };
|
contracts/proxy-actions/src/structs.rs|51 col 17| warning: unused variable: payment_to_next_task
--> contracts/proxy-actions/src/structs.rs:51:17
|
51 | let payment_to_next_task = self
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _payment_to_next_task
|
= note: #[warn(unused_variables)]
on by default
contracts/proxy-actions/src/structs.rs|77 col 17| warning: unused variable: payment_to_next_task
--> contracts/proxy-actions/src/structs.rs:77:17
|
77 | let payment_to_next_task = match task_type {
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _payment_to_next_task
contracts/proxy-actions/src/structs.rs|46 col 43| warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:46:43
|
46 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:46:36
|
46 | let payment_to_next_task = payment.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
contracts/proxy-actions/src/structs.rs|51 col 13| warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:51:13
|
51 | / let payment_to_next_task = self
52 | | .send()
53 | | .contract_call::(dest_addr, endpoint_name)
54 | | .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 | | .with_raw_arguments(endpoint_args.to_arg_buffer())
56 | | .with_gas_limit(gas_limit)
57 | | .transfer_execute();
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: #[warn(clippy::let_unit_value)]
on by default
help: omit the let
binding
|
51 ~ self
52 + .send()
53 + .contract_call::(dest_addr, endpoint_name)
54 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 + .with_raw_arguments(endpoint_args.to_arg_buffer())
56 + .with_gas_limit(gas_limit)
57 + .transfer_execute();
|
contracts/proxy-actions/src/structs.rs|72 col 43| warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:72:43
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:72:36
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
contracts/proxy-actions/src/structs.rs|77 col 13| warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:77:13
|
77 | / let payment_to_next_task = match task_type {
78 | | TaskType::WrapEGLD => {
79 | | //TODO
80 | | }
... |
117 | | }
118 | | };
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the let
binding
|
77 ~ match task_type {
78 + TaskType::WrapEGLD => {
79 + //TODO
80 + }
81 + TaskType::UnwrapEgld => {
82 + //TODO
83 + }
84 + TaskType::Swap => {
85 + let args = endpoint_args.into_vec_of_buffers();
86 + let token_out = TokenIdentifier::from(args.get(0).clone_value());
87 + let min_amount_out = BigUint::from(args.get(1).clone_value());
88 + let token_payment = payment_to_next_task
89 + .token_identifier
90 + .clone()
91 + .into_esdt_option();
92 + if token_payment.is_none() {
93 + return;
94 + }
95 + self.pair_contract_proxy(dest_addr)
96 + .swap_tokens_fixed_input(token_out, min_amount_out)
97 + .with_esdt_transfer(EsdtTokenPayment::new(
98 + token_payment.unwrap(),
99 + payment_to_next_task.token_nonce,
100 + payment_to_next_task.amount.clone(),
101 + ))
102 + .with_gas_limit(gas_limit)
103 + .transfer_execute();
104 + }
105 + TaskType::SendEsdt => {
106 + self.send()
107 + .contract_call::(dest_addr, b"".into())
108 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
109 + .with_gas_limit(gas_limit)
110 + .transfer_execute();
111 + }
112 + TaskType::ExitLP => {
113 + //TODO
114 + }
115 + TaskType::None => {
116 + // return Ok(())
117 + }
118 + };
|
Filtered Findings (0)
Annotations
Check warning on line 51 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L51
warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:51:17
|
51 | let payment_to_next_task = self
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
|
= note: `#[warn(unused_variables)]` on by default
Raw output
contracts/proxy-actions/src/structs.rs:51:17:w:warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:51:17
|
51 | let payment_to_next_task = self
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
|
= note: `#[warn(unused_variables)]` on by default
__END__
Check warning on line 77 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L77
warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:77:17
|
77 | let payment_to_next_task = match task_type {
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
Raw output
contracts/proxy-actions/src/structs.rs:77:17:w:warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:77:17
|
77 | let payment_to_next_task = match task_type {
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
__END__
Check warning on line 46 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L46
warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:46:43
|
46 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:46:36
|
46 | let payment_to_next_task = payment.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
Raw output
contracts/proxy-actions/src/structs.rs:46:43:w:warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:46:43
|
46 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:46:36
|
46 | let payment_to_next_task = payment.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
__END__
Check warning on line 51 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L51
warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:51:13
|
51 | / let payment_to_next_task = self
52 | | .send()
53 | | .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 | | .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 | | .with_raw_arguments(endpoint_args.to_arg_buffer())
56 | | .with_gas_limit(gas_limit)
57 | | .transfer_execute();
| |____________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `#[warn(clippy::let_unit_value)]` on by default
help: omit the `let` binding
|
51 ~ self
52 + .send()
53 + .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 + .with_raw_arguments(endpoint_args.to_arg_buffer())
56 + .with_gas_limit(gas_limit)
57 + .transfer_execute();
|
Raw output
contracts/proxy-actions/src/structs.rs:51:13:w:warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:51:13
|
51 | / let payment_to_next_task = self
52 | | .send()
53 | | .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 | | .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 | | .with_raw_arguments(endpoint_args.to_arg_buffer())
56 | | .with_gas_limit(gas_limit)
57 | | .transfer_execute();
| |____________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `#[warn(clippy::let_unit_value)]` on by default
help: omit the `let` binding
|
51 ~ self
52 + .send()
53 + .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 + .with_raw_arguments(endpoint_args.to_arg_buffer())
56 + .with_gas_limit(gas_limit)
57 + .transfer_execute();
|
__END__
Check warning on line 72 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L72
warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:72:43
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:72:36
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
Raw output
contracts/proxy-actions/src/structs.rs:72:43:w:warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:72:43
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:72:36
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
__END__
Check warning on line 77 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L77
warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:77:13
|
77 | / let payment_to_next_task = match task_type {
78 | | TaskType::WrapEGLD => {
79 | | //TODO
80 | | }
... |
117 | | }
118 | | };
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
77 ~ match task_type {
78 + TaskType::WrapEGLD => {
79 + //TODO
80 + }
81 + TaskType::UnwrapEgld => {
82 + //TODO
83 + }
84 + TaskType::Swap => {
85 + let args = endpoint_args.into_vec_of_buffers();
86 + let token_out = TokenIdentifier::from(args.get(0).clone_value());
87 + let min_amount_out = BigUint::from(args.get(1).clone_value());
88 + let token_payment = payment_to_next_task
89 + .token_identifier
90 + .clone()
91 + .into_esdt_option();
92 + if token_payment.is_none() {
93 + return;
94 + }
95 + self.pair_contract_proxy(dest_addr)
96 + .swap_tokens_fixed_input(token_out, min_amount_out)
97 + .with_esdt_transfer(EsdtTokenPayment::new(
98 + token_payment.unwrap(),
99 + payment_to_next_task.token_nonce,
100 + payment_to_next_task.amount.clone(),
101 + ))
102 + .with_gas_limit(gas_limit)
103 + .transfer_execute();
104 + }
105 + TaskType::SendEsdt => {
106 + self.send()
107 + .contract_call::<EsdtTokenPayment>(dest_addr, b"".into())
108 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
109 + .with_gas_limit(gas_limit)
110 + .transfer_execute();
111 + }
112 + TaskType::ExitLP => {
113 + //TODO
114 + }
115 + TaskType::None => {
116 + // return Ok(())
117 + }
118 + };
|
Raw output
contracts/proxy-actions/src/structs.rs:77:13:w:warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:77:13
|
77 | / let payment_to_next_task = match task_type {
78 | | TaskType::WrapEGLD => {
79 | | //TODO
80 | | }
... |
117 | | }
118 | | };
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
77 ~ match task_type {
78 + TaskType::WrapEGLD => {
79 + //TODO
80 + }
81 + TaskType::UnwrapEgld => {
82 + //TODO
83 + }
84 + TaskType::Swap => {
85 + let args = endpoint_args.into_vec_of_buffers();
86 + let token_out = TokenIdentifier::from(args.get(0).clone_value());
87 + let min_amount_out = BigUint::from(args.get(1).clone_value());
88 + let token_payment = payment_to_next_task
89 + .token_identifier
90 + .clone()
91 + .into_esdt_option();
92 + if token_payment.is_none() {
93 + return;
94 + }
95 + self.pair_contract_proxy(dest_addr)
96 + .swap_tokens_fixed_input(token_out, min_amount_out)
97 + .with_esdt_transfer(EsdtTokenPayment::new(
98 + token_payment.unwrap(),
99 + payment_to_next_task.token_nonce,
100 + payment_to_next_task.amount.clone(),
101 + ))
102 + .with_gas_limit(gas_limit)
103 + .transfer_execute();
104 + }
105 + TaskType::SendEsdt => {
106 + self.send()
107 + .contract_call::<EsdtTokenPayment>(dest_addr, b"".into())
108 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
109 + .with_gas_limit(gas_limit)
110 + .transfer_execute();
111 + }
112 + TaskType::ExitLP => {
113 + //TODO
114 + }
115 + TaskType::None => {
116 + // return Ok(())
117 + }
118 + };
|
__END__
Check warning on line 51 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L51
warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:51:17
|
51 | let payment_to_next_task = self
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
|
= note: `#[warn(unused_variables)]` on by default
Raw output
contracts/proxy-actions/src/structs.rs:51:17:w:warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:51:17
|
51 | let payment_to_next_task = self
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
|
= note: `#[warn(unused_variables)]` on by default
__END__
Check warning on line 77 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L77
warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:77:17
|
77 | let payment_to_next_task = match task_type {
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
Raw output
contracts/proxy-actions/src/structs.rs:77:17:w:warning: unused variable: `payment_to_next_task`
--> contracts/proxy-actions/src/structs.rs:77:17
|
77 | let payment_to_next_task = match task_type {
| ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_payment_to_next_task`
__END__
Check warning on line 46 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L46
warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:46:43
|
46 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:46:36
|
46 | let payment_to_next_task = payment.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
Raw output
contracts/proxy-actions/src/structs.rs:46:43:w:warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:46:43
|
46 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:46:36
|
46 | let payment_to_next_task = payment.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
__END__
Check warning on line 51 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L51
warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:51:13
|
51 | / let payment_to_next_task = self
52 | | .send()
53 | | .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 | | .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 | | .with_raw_arguments(endpoint_args.to_arg_buffer())
56 | | .with_gas_limit(gas_limit)
57 | | .transfer_execute();
| |____________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `#[warn(clippy::let_unit_value)]` on by default
help: omit the `let` binding
|
51 ~ self
52 + .send()
53 + .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 + .with_raw_arguments(endpoint_args.to_arg_buffer())
56 + .with_gas_limit(gas_limit)
57 + .transfer_execute();
|
Raw output
contracts/proxy-actions/src/structs.rs:51:13:w:warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:51:13
|
51 | / let payment_to_next_task = self
52 | | .send()
53 | | .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 | | .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 | | .with_raw_arguments(endpoint_args.to_arg_buffer())
56 | | .with_gas_limit(gas_limit)
57 | | .transfer_execute();
| |____________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `#[warn(clippy::let_unit_value)]` on by default
help: omit the `let` binding
|
51 ~ self
52 + .send()
53 + .contract_call::<EsdtTokenPayment>(dest_addr, endpoint_name)
54 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
55 + .with_raw_arguments(endpoint_args.to_arg_buffer())
56 + .with_gas_limit(gas_limit)
57 + .transfer_execute();
|
__END__
Check warning on line 72 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L72
warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:72:43
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:72:36
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
Raw output
contracts/proxy-actions/src/structs.rs:72:43:w:warning: redundant clone
--> contracts/proxy-actions/src/structs.rs:72:43
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> contracts/proxy-actions/src/structs.rs:72:36
|
72 | let payment_to_next_task = payment.clone();
| ^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
__END__
Check warning on line 77 in contracts/proxy-actions/src/structs.rs
github-actions / clippy
[clippy] contracts/proxy-actions/src/structs.rs#L77
warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:77:13
|
77 | / let payment_to_next_task = match task_type {
78 | | TaskType::WrapEGLD => {
79 | | //TODO
80 | | }
... |
117 | | }
118 | | };
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
77 ~ match task_type {
78 + TaskType::WrapEGLD => {
79 + //TODO
80 + }
81 + TaskType::UnwrapEgld => {
82 + //TODO
83 + }
84 + TaskType::Swap => {
85 + let args = endpoint_args.into_vec_of_buffers();
86 + let token_out = TokenIdentifier::from(args.get(0).clone_value());
87 + let min_amount_out = BigUint::from(args.get(1).clone_value());
88 + let token_payment = payment_to_next_task
89 + .token_identifier
90 + .clone()
91 + .into_esdt_option();
92 + if token_payment.is_none() {
93 + return;
94 + }
95 + self.pair_contract_proxy(dest_addr)
96 + .swap_tokens_fixed_input(token_out, min_amount_out)
97 + .with_esdt_transfer(EsdtTokenPayment::new(
98 + token_payment.unwrap(),
99 + payment_to_next_task.token_nonce,
100 + payment_to_next_task.amount.clone(),
101 + ))
102 + .with_gas_limit(gas_limit)
103 + .transfer_execute();
104 + }
105 + TaskType::SendEsdt => {
106 + self.send()
107 + .contract_call::<EsdtTokenPayment>(dest_addr, b"".into())
108 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
109 + .with_gas_limit(gas_limit)
110 + .transfer_execute();
111 + }
112 + TaskType::ExitLP => {
113 + //TODO
114 + }
115 + TaskType::None => {
116 + // return Ok(())
117 + }
118 + };
|
Raw output
contracts/proxy-actions/src/structs.rs:77:13:w:warning: this let-binding has unit value
--> contracts/proxy-actions/src/structs.rs:77:13
|
77 | / let payment_to_next_task = match task_type {
78 | | TaskType::WrapEGLD => {
79 | | //TODO
80 | | }
... |
117 | | }
118 | | };
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
77 ~ match task_type {
78 + TaskType::WrapEGLD => {
79 + //TODO
80 + }
81 + TaskType::UnwrapEgld => {
82 + //TODO
83 + }
84 + TaskType::Swap => {
85 + let args = endpoint_args.into_vec_of_buffers();
86 + let token_out = TokenIdentifier::from(args.get(0).clone_value());
87 + let min_amount_out = BigUint::from(args.get(1).clone_value());
88 + let token_payment = payment_to_next_task
89 + .token_identifier
90 + .clone()
91 + .into_esdt_option();
92 + if token_payment.is_none() {
93 + return;
94 + }
95 + self.pair_contract_proxy(dest_addr)
96 + .swap_tokens_fixed_input(token_out, min_amount_out)
97 + .with_esdt_transfer(EsdtTokenPayment::new(
98 + token_payment.unwrap(),
99 + payment_to_next_task.token_nonce,
100 + payment_to_next_task.amount.clone(),
101 + ))
102 + .with_gas_limit(gas_limit)
103 + .transfer_execute();
104 + }
105 + TaskType::SendEsdt => {
106 + self.send()
107 + .contract_call::<EsdtTokenPayment>(dest_addr, b"".into())
108 + .with_egld_or_single_esdt_transfer(payment_to_next_task.clone())
109 + .with_gas_limit(gas_limit)
110 + .transfer_execute();
111 + }
112 + TaskType::ExitLP => {
113 + //TODO
114 + }
115 + TaskType::None => {
116 + // return Ok(())
117 + }
118 + };
|
__END__