From ae4e5ab81bc5809e8c87d343ef8836e5bf6fa94d Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Sat, 1 Jul 2017 13:59:36 -0700 Subject: [PATCH] Cosmetic change --- src/config.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.rs b/src/config.rs index 75aa351..a0c6465 100644 --- a/src/config.rs +++ b/src/config.rs @@ -29,7 +29,7 @@ pub struct ConfigUser { } #[derive(Deserialize)] -pub struct UserConfig { +pub struct Config { pub album_art_pattern: Option, pub reindex_every_n_seconds: Option, pub mount_dirs: Option>, @@ -37,14 +37,14 @@ pub struct UserConfig { pub ydns: Option, } -pub fn parse(path: &path::Path) -> Result { +pub fn parse(path: &path::Path) -> Result { println!("Config file path: {}", path.to_string_lossy()); // Parse user config let mut config_file = fs::File::open(path)?; let mut config_file_content = String::new(); config_file.read_to_string(&mut config_file_content)?; - let mut config = toml::de::from_str::(config_file_content.as_str())?; + let mut config = toml::de::from_str::(config_file_content.as_str())?; // Clean path if let Some(ref mut mount_dirs) = config.mount_dirs { @@ -72,14 +72,14 @@ fn reset(db: &T) -> Result<()> Ok(()) } -pub fn overwrite(db: &T, new_config: &UserConfig) -> Result<()> +pub fn overwrite(db: &T, new_config: &Config) -> Result<()> where T: ConnectionSource { reset(db)?; ammend(db, new_config) } -pub fn ammend(db: &T, new_config: &UserConfig) -> Result<()> +pub fn ammend(db: &T, new_config: &Config) -> Result<()> where T: ConnectionSource { let connection = db.get_connection();