diff --git a/src/config.rs b/src/config.rs index 232bb71..5276938 100644 --- a/src/config.rs +++ b/src/config.rs @@ -52,6 +52,15 @@ impl Default for &Core { } } +impl Default for Core { + fn default() -> Self { + Core { + buffer_size: 64, + auto_commit: false, + } + } +} + impl Default for Theme { fn default() -> Self { let font = ThemeFont { @@ -93,6 +102,11 @@ mod tests { let config = Config::from_file(Path::new("./data/sample.toml")); assert!(config.is_ok()); + // Load default core and theme. + let config = config.unwrap(); + config.core.unwrap_or_default(); + config.theme.unwrap_or_default(); + let config = Config::from_file(Path::new("./data/full_sample.toml")); assert!(config.is_ok());