Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(l2): add clippy suggestions (#951)
**Motivation** Clippy was throwing some warnings, applying it suggestions. **Description** Command: ```sh cargo clippy --all-targets --all-features --workspace -- -D warnings ``` Output to Fix: ``` warning: it looks like you're manually copying between slices --> cmd/ethereum_rust_l2/src/commands/test.rs:77:5 | 77 | / for i in 0..64 { 78 | | buffer[i] = public_key[i + 1]; 79 | | } | |_____^ help: try replacing the loop by: `buffer.copy_from_slice(&public_key[1..(64 + 1)]);` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy = note: `#[warn(clippy::manual_memcpy)]` on by default warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> cmd/ethereum_rust_l2/src/commands/test.rs:133:21 | 133 | for line in lines { | ^ ----- help: try: `lines.flatten()` | _____________________| | | 134 | | if let Ok(pk) = line { 135 | | let thread = tokio::spawn(transfer_from( 136 | | pk, ... | 144 | | } 145 | | } | |_____________________^ | help: ...and remove the `if let` statement in the for loop --> cmd/ethereum_rust_l2/src/commands/test.rs:134:25 | 134 | / if let Ok(pk) = line { 135 | | let thread = tokio::spawn(transfer_from( 136 | | pk, 137 | | to_address.clone(), ... | 143 | | threads.push(thread); 144 | | } | |_________________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten = note: `#[warn(clippy::manual_flatten)]` on by default warning: using `clone` on type `H160` which implements the `Copy` trait --> cmd/ethereum_rust_l2/src/commands/test.rs:137:33 | 137 | ... to_address.clone(), | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `to_address` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default ```
- Loading branch information