Lottery SC audit fixes #2216
reviewdog [clippy] report
reported by reviewdog 🐶
Findings (8)
contracts/examples/lottery-esdt/src/lottery.rs|269 col 36| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:269:36
|
269 | self.total_winning_tickets(&lottery_name)
| ^^^^^^^^^^^^^ help: change this to: lottery_name
|
= 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
contracts/examples/lottery-esdt/src/lottery.rs|279 col 60| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:279:60
|
279 | let mut index_last_winner = self.index_last_winner(&lottery_name).get();
| ^^^^^^^^^^^^^ help: change this to: lottery_name
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
contracts/examples/lottery-esdt/src/lottery.rs|325 col 50| warning: the borrowed expression implements the required traits
--> contracts/examples/lottery-esdt/src/lottery.rs:325:50
|
325 | self.index_last_winner(lottery_name).set(&index_last_winner);
| ^^^^^^^^^^^^^^^^^^ help: change this to: index_last_winner
|
= 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
contracts/examples/lottery-esdt/src/lottery.rs|412 col 57| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:412:57
|
412 | let value = self.accumulated_rewards(&token_id, &caller).take();
| ^^^^^^^ help: change this to: caller
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
contracts/examples/lottery-esdt/src/lottery.rs|269 col 36| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:269:36
|
269 | self.total_winning_tickets(&lottery_name)
| ^^^^^^^^^^^^^ help: change this to: lottery_name
|
= 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
contracts/examples/lottery-esdt/src/lottery.rs|279 col 60| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:279:60
|
279 | let mut index_last_winner = self.index_last_winner(&lottery_name).get();
| ^^^^^^^^^^^^^ help: change this to: lottery_name
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
contracts/examples/lottery-esdt/src/lottery.rs|325 col 50| warning: the borrowed expression implements the required traits
--> contracts/examples/lottery-esdt/src/lottery.rs:325:50
|
325 | self.index_last_winner(lottery_name).set(&index_last_winner);
| ^^^^^^^^^^^^^^^^^^ help: change this to: index_last_winner
|
= 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
contracts/examples/lottery-esdt/src/lottery.rs|412 col 57| warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:412:57
|
412 | let value = self.accumulated_rewards(&token_id, &caller).take();
| ^^^^^^^ help: change this to: caller
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Filtered Findings (0)
Annotations
Check warning on line 269 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L269
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:269:36
|
269 | self.total_winning_tickets(&lottery_name)
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= 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
contracts/examples/lottery-esdt/src/lottery.rs:269:36:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:269:36
|
269 | self.total_winning_tickets(&lottery_name)
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= 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 279 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L279
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:279:60
|
279 | let mut index_last_winner = self.index_last_winner(&lottery_name).get();
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Raw output
contracts/examples/lottery-esdt/src/lottery.rs:279:60:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:279:60
|
279 | let mut index_last_winner = self.index_last_winner(&lottery_name).get();
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
__END__
Check warning on line 325 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L325
warning: the borrowed expression implements the required traits
--> contracts/examples/lottery-esdt/src/lottery.rs:325:50
|
325 | self.index_last_winner(lottery_name).set(&index_last_winner);
| ^^^^^^^^^^^^^^^^^^ help: change this to: `index_last_winner`
|
= 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
Raw output
contracts/examples/lottery-esdt/src/lottery.rs:325:50:w:warning: the borrowed expression implements the required traits
--> contracts/examples/lottery-esdt/src/lottery.rs:325:50
|
325 | self.index_last_winner(lottery_name).set(&index_last_winner);
| ^^^^^^^^^^^^^^^^^^ help: change this to: `index_last_winner`
|
= 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
__END__
Check warning on line 412 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L412
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:412:57
|
412 | let value = self.accumulated_rewards(&token_id, &caller).take();
| ^^^^^^^ help: change this to: `caller`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Raw output
contracts/examples/lottery-esdt/src/lottery.rs:412:57:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:412:57
|
412 | let value = self.accumulated_rewards(&token_id, &caller).take();
| ^^^^^^^ help: change this to: `caller`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
__END__
Check warning on line 269 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L269
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:269:36
|
269 | self.total_winning_tickets(&lottery_name)
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= 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
contracts/examples/lottery-esdt/src/lottery.rs:269:36:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:269:36
|
269 | self.total_winning_tickets(&lottery_name)
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= 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 279 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L279
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:279:60
|
279 | let mut index_last_winner = self.index_last_winner(&lottery_name).get();
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Raw output
contracts/examples/lottery-esdt/src/lottery.rs:279:60:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:279:60
|
279 | let mut index_last_winner = self.index_last_winner(&lottery_name).get();
| ^^^^^^^^^^^^^ help: change this to: `lottery_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
__END__
Check warning on line 325 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L325
warning: the borrowed expression implements the required traits
--> contracts/examples/lottery-esdt/src/lottery.rs:325:50
|
325 | self.index_last_winner(lottery_name).set(&index_last_winner);
| ^^^^^^^^^^^^^^^^^^ help: change this to: `index_last_winner`
|
= 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
Raw output
contracts/examples/lottery-esdt/src/lottery.rs:325:50:w:warning: the borrowed expression implements the required traits
--> contracts/examples/lottery-esdt/src/lottery.rs:325:50
|
325 | self.index_last_winner(lottery_name).set(&index_last_winner);
| ^^^^^^^^^^^^^^^^^^ help: change this to: `index_last_winner`
|
= 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
__END__
Check warning on line 412 in contracts/examples/lottery-esdt/src/lottery.rs
github-actions / clippy
[clippy] contracts/examples/lottery-esdt/src/lottery.rs#L412
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:412:57
|
412 | let value = self.accumulated_rewards(&token_id, &caller).take();
| ^^^^^^^ help: change this to: `caller`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Raw output
contracts/examples/lottery-esdt/src/lottery.rs:412:57:w:warning: this expression creates a reference which is immediately dereferenced by the compiler
--> contracts/examples/lottery-esdt/src/lottery.rs:412:57
|
412 | let value = self.accumulated_rewards(&token_id, &caller).take();
| ^^^^^^^ help: change this to: `caller`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
__END__