From 8e98cfd2fed818a1fcd4b2073bb6767e5475beb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sat, 29 Apr 2023 12:53:43 +0200 Subject: Use a dedicated static for the default config name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- src/config.rs | 1 + src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 0ed2a6b..f917e15 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,6 +8,7 @@ use crate::error::Error; use crate::fragment::FragmentDataDesc; pub const CONFIG_FILE_NAMES: &[&str] = &[".changelog.toml", "changelog.toml"]; +pub const CONFIG_FILE_DEFAULT_NAME: &str = CONFIG_FILE_NAMES[1]; pub const DEFAULT_CONFIG: &str = include_str!("../assets/default_config.toml"); #[derive(Debug, getset::Getters, getset::CopyGetters, serde::Deserialize, serde::Serialize)] diff --git a/src/main.rs b/src/main.rs index 5e618c5..d57e5f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,7 +118,7 @@ fn init(repo_workdir_path: PathBuf) -> miette::Result<()> { .create(true) .append(false) .write(true) - .open(repo_workdir_path.join(crate::config::CONFIG_FILE_NAMES[1])) + .open(repo_workdir_path.join(crate::config::CONFIG_FILE_DEFAULT_NAME)) .map_err(Error::from) .into_diagnostic()?; -- cgit v1.2.3