From 3f3ba75f24d20628b1296dd9434062163232e5e0 Mon Sep 17 00:00:00 2001 From: PredaaA <46051820+PredaaA@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:57:30 +0000 Subject: [PATCH] Fix webhook_url can be none --- src/discord_log.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/discord_log.rs b/src/discord_log.rs index 3c5b078..f5603f2 100644 --- a/src/discord_log.rs +++ b/src/discord_log.rs @@ -15,7 +15,8 @@ pub fn discord_log( let message: String = message.into(); tokio::spawn(async move { - let webhook_url = CONFIG.webhook_url.clone().unwrap(); + let binding = "".to_string(); + let webhook_url = CONFIG.webhook_url.as_ref().unwrap_or(&binding); if webhook_url.is_empty() { return; }