diff --git a/src/settings/mod.rs b/src/settings/mod.rs index 13f23df..926156d 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -4,14 +4,13 @@ extern crate serde_yaml; use serde::{Deserialize, Serialize}; extern crate log; -use log::warn; +use log::{info, warn}; // mod utils; pub mod utils; use utils::SettingsType; -#[allow(dead_code)] -const RULESET_CURRENT_VERSION: &'static str = "1"; +const RULESET_CURRENT_VERSION: i32 = 1; #[derive(Debug, Deserialize, Serialize)] pub struct Settings { @@ -106,7 +105,7 @@ impl Settings { Ok(val) => val, }, }; - + info!("Successfuly imported {}", path.display()); Ok(settings) } @@ -161,12 +160,13 @@ impl Settings { Ok(val) => val, }, }; + info!("Successfuly exported settings to {}", path.display()); utils::write_file(&path, &content) } /// Get the current ruleset version of LangEvolve. fn get_ruleset_version() -> String { - String::from(RULESET_CURRENT_VERSION) + RULESET_CURRENT_VERSION.to_string() } } diff --git a/src/settings/utils.rs b/src/settings/utils.rs index 557c449..ece95b5 100644 --- a/src/settings/utils.rs +++ b/src/settings/utils.rs @@ -6,6 +6,7 @@ use std::io::{Read, Result}; use std::path::Path; /// Type of supported settings format: yaml or json +#[derive(Debug, PartialEq)] pub enum SettingsType { /// Files ending with the `yml` or `yaml` extension Yaml, @@ -78,6 +79,7 @@ where info!("Wrote settings to file {}", path.display()); } }; + info!("Successfuly written {}", path.display()); Ok(()) }