Remove redundant calls to borrow() (#1393)

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
This commit is contained in:
Marcin S
2023-09-05 12:11:30 +02:00
committed by GitHub
parent 12194445b2
commit ec8949f624
3 changed files with 5 additions and 9 deletions
+1 -4
View File
@@ -49,7 +49,6 @@ pub trait UsageProvider<Block: sp_runtime::traits::Block> {
pub mod utils {
use sp_blockchain::{Error, HeaderBackend, HeaderMetadata};
use sp_runtime::traits::Block as BlockT;
use std::borrow::Borrow;
/// Returns a function for checking block ancestry, the returned function will
/// return `true` if the given hash (second parameter) is a descendent of the
@@ -69,10 +68,8 @@ pub mod utils {
return Ok(false)
}
let current = current.as_ref().map(|(c, p)| (c.borrow(), p.borrow()));
let mut hash = hash;
if let Some((current_hash, current_parent_hash)) = current {
if let Some((current_hash, current_parent_hash)) = &current {
if base == current_hash {
return Ok(false)
}