Cleans up the code a bit
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(", "))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user