Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit bd972a2

Browse files
committed
Clippy 🤦
1 parent 0616c78 commit bd972a2

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

client/db/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ impl<Block: BlockT> Backend<Block> {
16161616
let number = header.number();
16171617
let hash = header.hash();
16181618

1619-
self.set_head_with_transaction(&mut transaction, hash.clone(), (*number, hash))?;
1619+
self.set_head_with_transaction(&mut transaction, hash, (*number, hash))?;
16201620

16211621
meta_updates.push(MetaUpdate {
16221622
hash,
@@ -2244,7 +2244,7 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
22442244
};
22452245
if is_genesis {
22462246
if let Some(genesis_state) = &*self.genesis_state.read() {
2247-
let root = genesis_state.root.clone();
2247+
let root = genesis_state.root;
22482248
let db_state = DbStateBuilder::<Block>::new(genesis_state.clone(), root)
22492249
.with_optional_cache(self.shared_trie_cache.as_ref().map(|c| c.local_cache()))
22502250
.build();

primitives/state-machine/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@ mod tests {
19381938

19391939
let trie: InMemoryBackend<BlakeTwo256> =
19401940
(storage.clone(), StateVersion::default()).into();
1941-
let trie_root = trie.root().clone();
1941+
let trie_root = *trie.root();
19421942
let backend = TrieBackendBuilder::wrap(&trie).with_recorder(Default::default()).build();
19431943
let mut queries = Vec::new();
19441944
for c in 0..(5 + nb_child_trie / 2) {

primitives/state-machine/src/trie_backend.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,11 @@ pub mod tests {
10551055
&b"doesnotexist2"[..],
10561056
];
10571057

1058-
fn check_estimation<'a>(
1058+
fn check_estimation(
10591059
backend: TrieBackend<
10601060
impl TrieBackendStorage<BlakeTwo256>,
10611061
BlakeTwo256,
1062-
&'a LocalTrieCache<BlakeTwo256>,
1062+
&'_ LocalTrieCache<BlakeTwo256>,
10631063
>,
10641064
has_cache: bool,
10651065
) {

primitives/trie/src/cache/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ mod tests {
551551

552552
let storage_proof = recorder.drain_storage_proof();
553553
let mut memory_db: MemoryDB = storage_proof.into_memory_db();
554-
let mut proof_root = root.clone();
554+
let mut proof_root = root;
555555

556556
{
557557
let mut trie =
@@ -619,7 +619,7 @@ mod tests {
619619
.node_cache()
620620
.lru
621621
.iter()
622-
.map(|d| d.0.clone())
622+
.map(|d| *d.0)
623623
.collect::<Vec<_>>();
624624

625625
// Delete the value cache, so that we access the nodes.
@@ -644,7 +644,7 @@ mod tests {
644644
.node_cache()
645645
.lru
646646
.iter()
647-
.map(|d| d.0.clone())
647+
.map(|d| *d.0)
648648
.collect::<Vec<_>>()
649649
);
650650
}

0 commit comments

Comments
 (0)