clippy: add implicit_clone clippy lint (#10529)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
Thomas Coratger
2024-08-26 04:34:31 -07:00
committed by GitHub
parent 709e7b73ce
commit 655495d8c3
5 changed files with 5 additions and 4 deletions

View File

@ -216,6 +216,7 @@ unused_rounding = "warn"
use_self = "warn"
useless_let_if_seq = "warn"
zero_sized_map_values = "warn"
implicit_clone = "warn"
cloned_instead_of_copied = "warn"
option_as_ref_cloned = "warn"

View File

@ -299,7 +299,7 @@ mod tests {
let expected = entries[id];
assert_eq!(
entry.unwrap(),
(expected.0.encode().to_vec(), expected.1.compress().to_vec())
(expected.0.encode().to_vec(), expected.1.compress().clone())
);
}

View File

@ -295,7 +295,7 @@ impl<D> ChainPath<D> {
pub fn static_files(&self) -> PathBuf {
let datadir_args = &self.2;
if let Some(static_files_path) = &datadir_args.static_files_path {
static_files_path.to_path_buf()
static_files_path.clone()
} else {
self.data_dir().join("static_files")
}

View File

@ -335,7 +335,7 @@ impl Transaction {
match self {
Self::Legacy(_) | Self::Eip2930(_) | Self::Eip1559(_) | Self::Eip7702(_) => None,
Self::Eip4844(TxEip4844 { blob_versioned_hashes, .. }) => {
Some(blob_versioned_hashes.to_vec())
Some(blob_versioned_hashes.clone())
}
#[cfg(feature = "optimism")]
Self::Deposit(_) => None,

View File

@ -1577,7 +1577,7 @@ mod tests {
provider.set_safe(safe_block.header.clone());
provider.set_finalized(finalized_block.header.clone());
Ok((provider, database_blocks.to_vec(), in_memory_blocks.to_vec(), receipts))
Ok((provider, database_blocks.clone(), in_memory_blocks.clone(), receipts))
}
#[allow(clippy::type_complexity)]