Skip to content

Commit

Permalink
refactor(config): utilize match expression
Browse files Browse the repository at this point in the history
  • Loading branch information
anweisen committed Jan 3, 2024
1 parent 04d00da commit 7e83fda
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ pub struct ComposedConfigs {
impl ComposedConfigs {
fn new(favicon: Option<String>, 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);
Expand Down

0 comments on commit 7e83fda

Please sign in to comment.