Skip to content

Commit 9c6b06e

Browse files
committed
clippy
1 parent 81da4de commit 9c6b06e

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

node/src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fn start_babe_service(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> {
273273
return start_babe_service(arg_matches);
274274
// Unknown error, return it.
275275
} else {
276-
log::error!("Failed to start Babe service: {:?}", e);
276+
log::error!("Failed to start Babe service: {e:?}");
277277
Err(e.into())
278278
}
279279
}

node/src/consensus/aura_wrapped_import_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ where
126126
let parent_header = self
127127
.client
128128
.header(*first_babe_block_header.parent_hash())
129-
.map_err(|e| format!("Failed to get parent header: {}", e))?
129+
.map_err(|e| format!("Failed to get parent header: {e}"))?
130130
.ok_or("Parent header not found".to_string())?;
131131
let grandparent_hash = parent_header.parent_hash();
132132

133133
let runtime_api = self.client.runtime_api();
134134
let authorities = runtime_api
135135
.authorities(*grandparent_hash)
136-
.map_err(|e| format!("Failed to get Aura authorities: {}", e))?;
136+
.map_err(|e| format!("Failed to get Aura authorities: {e}"))?;
137137

138138
Ok(authorities)
139139
}

node/src/service.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,13 @@ fn copy_keys(
790790
let to_keys: HashSet<_> = keystore.raw_public_keys(to_key_type)?.into_iter().collect();
791791
let to_copy: Vec<_> = from_keys.difference(&to_keys).collect();
792792

793-
log::debug!(target: LOG_TARGET, "from_keys: {:?}", from_keys);
794-
log::debug!(target: LOG_TARGET, "to_keys: {:?}", to_keys);
793+
log::debug!(target: LOG_TARGET, "from_keys: {from_keys:?}");
794+
log::debug!(target: LOG_TARGET, "to_keys: {to_keys:?}");
795795
log::debug!(target: LOG_TARGET, "to_copy: {:?} from {:?} to {:?}", &to_copy, from_key_type, to_key_type);
796796

797797
for public in to_copy {
798-
if let Some(phrase) = keystore.key_phrase_by_type(&public, from_key_type)? {
799-
if let Err(_) = keystore.insert(to_key_type, &phrase, &public) {
798+
if let Some(phrase) = keystore.key_phrase_by_type(public, from_key_type)? {
799+
if keystore.insert(to_key_type, &phrase, public).is_err() {
800800
log::error!(
801801
target: LOG_TARGET,
802802
"Failed to copy key {:?} into keystore, insert operation failed.",
@@ -806,9 +806,7 @@ fn copy_keys(
806806
} else {
807807
log::error!(
808808
target: LOG_TARGET,
809-
"Failed to copy key from {:?} to {:?} as the key phrase is not available",
810-
from_key_type,
811-
to_key_type
809+
"Failed to copy key from {from_key_type:?} to {to_key_type:?} as the key phrase is not available"
812810
);
813811
}
814812
}

0 commit comments

Comments
 (0)