Cleans up the code a bit

This commit is contained in:
2025-07-12 20:00:44 +02:00
parent df1e3ff905
commit ad0e81fdc3
8 changed files with 21 additions and 21 deletions

View File

@@ -65,7 +65,7 @@ impl Config {
let config_path = Self::config_path();
if !fs::exists(&config_path)? {
let config_error = ConfigError(format!("Cannot create parent directory for config file: {}", &config_path.display()).to_string());
let _ = fs::create_dir_all(&config_path.parent().ok_or(config_error)?)?;
fs::create_dir_all(config_path.parent().ok_or(config_error)?)?;
let config = Config::new();
fs::write(&config_path, serde_json::to_string_pretty(&config)?.as_bytes())?;
@@ -83,3 +83,9 @@ impl Config {
Ok(())
}
}
impl Default for Config {
fn default() -> Self {
Self::new()
}
}

View File

@@ -6,7 +6,7 @@ pub struct Participants<'a>(pub &'a Vec<User>);
impl<'a> Display for Participants<'a> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let string_list: Vec<String> = self.0.iter().map(|x| {format!("{}", x)}).collect();
let string_list: Vec<String> = self.0.iter().map(|x| {format!("{x}")}).collect();
write!(f, "{}", string_list.join(", "))
}
}