diff --git a/src/config.rs b/src/config.rs index 187fb9f..a5382a6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -66,12 +66,8 @@ fn parse_server_dir(mut config: Value, server_config_path: PathBuf) config = merge_config_maps(config, client_config)?; }, "channels.toml" => { - let channels = Value::from(parse_toml_to_table(entry.path())?); - if config.contains_key(&"channels".to_owned()) { - config[&"channels".to_owned()] = channels; - } else { - config.insert("channels".to_owned(), channels); - } + let channel_config = parse_toml_to_table(entry.path())?; + config = merge_config_maps(config, channel_config)?; }, _ => (), } diff --git a/src/main.rs b/src/main.rs index 6b155d2..b757f6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,8 +79,10 @@ fn main() { for s_conf in server_configs { let t = tx.clone(); + let addr = s_conf.get("server").unwrap().as_str() + .ok_or("Could not get server adress from config").unwrap(); server_threads.push(thread::Builder::new() - .name("server name here".to_string()) + .name(addr.to_string()) .spawn(move || { servers::handle_server(s_conf, t, 5).unwrap(); })