mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
fixes for nightly clippy (#1618)
This commit is contained in:
committed by
Bastian Köcher
parent
9592b55fea
commit
f58e076ca2
@@ -68,7 +68,7 @@ pub fn initialize_logger(with_timestamp: bool) {
|
||||
let log_level = color_level(record.level());
|
||||
let log_target = color_target(record.target());
|
||||
|
||||
writeln!(buf, "{}{} {} {}", loop_name_prefix(), log_level, log_target, record.args(),)
|
||||
writeln!(buf, "{}{log_level} {log_target} {}", loop_name_prefix(), record.args(),)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ fn loop_name_prefix() -> String {
|
||||
if loop_name.is_empty() {
|
||||
String::new()
|
||||
} else {
|
||||
format!("[{}] ", loop_name)
|
||||
format!("[{loop_name}] ")
|
||||
}
|
||||
})
|
||||
.unwrap_or_else(|_| String::new())
|
||||
@@ -105,8 +105,8 @@ enum Either<A, B> {
|
||||
impl<A: Display, B: Display> Display for Either<A, B> {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Left(a) => write!(fmt, "{}", a),
|
||||
Self::Right(b) => write!(fmt, "{}", b),
|
||||
Self::Left(a) => write!(fmt, "{a}"),
|
||||
Self::Right(b) => write!(fmt, "{b}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,12 +189,12 @@ pub fn format_ids<Id: std::fmt::Debug>(mut ids: impl ExactSizeIterator<Item = Id
|
||||
2 => {
|
||||
let id0 = ids.next().expect(NTH_PROOF);
|
||||
let id1 = ids.next().expect(NTH_PROOF);
|
||||
format!("[{:?}, {:?}]", id0, id1)
|
||||
format!("[{id0:?}, {id1:?}]")
|
||||
},
|
||||
len => {
|
||||
let id0 = ids.next().expect(NTH_PROOF);
|
||||
let id_last = ids.last().expect(NTH_PROOF);
|
||||
format!("{}:[{:?} ... {:?}]", len, id0, id_last)
|
||||
format!("{len}:[{id0:?} ... {id_last:?}]")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ impl From<Option<MetricsAddress>> for MetricsParams {
|
||||
/// Returns metric name optionally prefixed with given prefix.
|
||||
pub fn metric_name(prefix: Option<&str>, name: &str) -> String {
|
||||
if let Some(prefix) = prefix {
|
||||
format!("{}_{}", prefix, name)
|
||||
format!("{prefix}_{name}")
|
||||
} else {
|
||||
name.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user