From e5fe5e3cf43e0a144e1d007616652c302c6bf8f8 Mon Sep 17 00:00:00 2001 From: Niklas Elsbrock Date: Sun, 26 May 2024 23:16:25 +0200 Subject: [PATCH] make clippy happy --- src/bin/disbahn.rs | 4 ++-- src/lib.rs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bin/disbahn.rs b/src/bin/disbahn.rs index 571d412..f602485 100644 --- a/src/bin/disbahn.rs +++ b/src/bin/disbahn.rs @@ -59,13 +59,13 @@ async fn main() -> anyhow::Result<()> { result = wait_for_shutdown_signal() => { result.expect("error on waiting for shutdown signal"); true }, - _ = tokio::time::sleep(Duration::from_secs(sleep_duration)) => false, + () = tokio::time::sleep(Duration::from_secs(sleep_duration)) => false, }; if shutdown { break Ok(()); } if let Err(err) = disbahn_client.refresh().await { - error!("{}", err) + error!("{}", err); } } } else { diff --git a/src/lib.rs b/src/lib.rs index 1bd02cb..8a2adcf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,7 +52,7 @@ impl DisbahnClient { static RE_STRIKETHROUGH: &Lazy = regex!(r#"((.|\n)*?)"#i); static RE_NEWLINE: &Lazy = regex!(r#""#i); - let input = RE_TIMES.replace(&input, ""); + let input = RE_TIMES.replace(input, ""); let input = RE_BOLD.replace_all(&input, "**$1**"); let input = RE_ITALIC.replace_all(&input, "*$1*"); let input = RE_STRIKETHROUGH.replace_all(&input, "~~$1~~"); @@ -102,8 +102,7 @@ impl DisbahnClient { let icon = categories .iter() .find(|c| c.domain() == Some("icon")) - .map(|c| c.name()) - .unwrap_or(""); + .map_or("", |c| c.name()); let icon_url = Self::icon_name_to_url(icon); let description = Self::html_to_discord_markdown( @@ -122,8 +121,8 @@ impl DisbahnClient { .thumbnail(icon_url) .colour(Self::icon_name_to_colour(icon)) .description(description) - .field("Beginn:", format!("", validity_begin), true) - .field("Ende:", format!("", validity_end), true) + .field("Beginn:", format!(""), true) + .field("Ende:", format!(""), true) .field("Hinweis:", include_str!("hint.txt"), false) .timestamp(pub_datetime) .footer(