From 7e83fda919ae1f4a398860ab6f3d613f5baff554 Mon Sep 17 00:00:00 2001 From: Angelo Date: Wed, 3 Jan 2024 23:25:33 +0100 Subject: [PATCH] refactor(config): utilize match expression --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 05cde43..c6f4df0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,10 +88,9 @@ pub struct ComposedConfigs { impl ComposedConfigs { fn new(favicon: Option, config: &Config) -> Self { let motd = ServerStatus::generate_json(favicon.clone(), &config, false); - let motd_component = if config.motd.component == Value::Null { - motd.clone() - } else { - ServerStatus::generate_json(favicon.clone(), &config, true) + let motd_component = match config.motd.component { + Value::Null => motd.clone(), + _ => ServerStatus::generate_json(favicon.clone(), &config, true), }; let disconnect = DisconnectMessage::generate_json(&config, false);