Skip to content

Commit 510ac0e

Browse files
committed
clippy: fix new format lint
1 parent 750207d commit 510ac0e

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ async fn main() -> Result<(), anyhow::Error> {
233233
)
234234
.rpcmethod(
235235
"summars-refreshalias",
236-
"Show summary of channels and optionally recent forwards",
236+
"Refresh the alias cache manually",
237237
summars_refreshalias,
238238
)
239239
.dynamic()
@@ -243,7 +243,7 @@ async fn main() -> Result<(), anyhow::Error> {
243243
Some(plugin) => {
244244
match get_startup_options(&plugin, state.clone()) {
245245
Ok(()) => &(),
246-
Err(e) => return plugin.disable(format!("{}", e).as_str()).await,
246+
Err(e) => return plugin.disable(format!("{e}").as_str()).await,
247247
};
248248
info!("read startup options done");
249249

@@ -257,7 +257,7 @@ async fn main() -> Result<(), anyhow::Error> {
257257
tokio::spawn(async move {
258258
match tasks::trace_availability(traceclone).await {
259259
Ok(()) => (),
260-
Err(e) => warn!("Error in trace_availability thread: {}", e),
260+
Err(e) => warn!("Error in trace_availability thread: {e}"),
261261
};
262262
});
263263

@@ -268,7 +268,7 @@ async fn main() -> Result<(), anyhow::Error> {
268268
loop {
269269
match tasks::refresh_alias(aliasclone.clone()).await {
270270
Ok(()) => (),
271-
Err(e) => warn!("Error in refresh_alias thread: {}", e),
271+
Err(e) => warn!("Error in refresh_alias thread: {e}"),
272272
};
273273
time::sleep(Duration::from_secs(alias_refresh_freq * 60 * 60)).await;
274274
}

src/structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub struct Pays {
311311

312312
fn fmt_option<T: Display>(o: &Option<T>) -> String {
313313
match o {
314-
Some(s) => format!("{}", s),
314+
Some(s) => format!("{s}"),
315315
None => MISSING_VALUE.to_owned(),
316316
}
317317
}

src/summary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ fn format_summary(config: &Config, sumtable: &mut Table) -> Result<(), Error> {
684684
if av < 0.0 {
685685
"N/A".to_owned()
686686
} else {
687-
format!("{:.1}%", av)
687+
format!("{av:.1}%")
688688
}
689689
})),
690690
);

src/tasks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub async fn trace_availability(plugin: Plugin<PluginState>) -> Result<(), Error
7474
warn!("Could not open {}: {}. Maybe this is the first time using summars? Creating new file.", availdbfile.to_str().unwrap(),e);
7575
match fs::create_dir(summarsdir.clone()).await {
7676
Ok(_) => (),
77-
Err(e) => warn!("Warning: Could not create summars folder:{}", e),
77+
Err(e) => warn!("Warning: Could not create summars folder:{e}"),
7878
};
7979
File::create(availdbfile.clone()).await?;
8080
persistpeers = BTreeMap::new();

src/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub fn draw_chans_graph(
8989
right = format!("{:23}", draw.bar.repeat(their_len - 1) + &draw.right);
9090
}
9191

92-
format!("{}{}{}", left, mid, right)
92+
format!("{left}{mid}{right}")
9393
}
9494

9595
pub fn u64_to_btc_string(config: &Config, amount_msat: u64) -> Result<String, Error> {
@@ -166,7 +166,7 @@ pub fn timestamp_to_localized_datetime_string(
166166
pub fn hex_encode(bytes: &[u8]) -> String {
167167
let mut hex_string = String::with_capacity(bytes.len() * 2);
168168
for byte in bytes {
169-
hex_string.push_str(&format!("{:02x}", byte));
169+
hex_string.push_str(&format!("{byte:02x}"));
170170
}
171171
hex_string
172172
}

0 commit comments

Comments
 (0)