summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Müller <neikos@neikos.email>2023-04-29 12:53:43 +0200
committerMarcel Müller <neikos@neikos.email>2023-04-29 12:53:59 +0200
commit8e98cfd2fed818a1fcd4b2073bb6767e5475beb0 (patch)
tree06a9743e5e90544466ef3c45ab19795cf71d7c9d
parentd2edda63b18801a0cd4514c001cacdd1d0b2f10a (diff)
Use a dedicated static for the default config name
Signed-off-by: Marcel Müller <neikos@neikos.email>
-rw-r--r--src/config.rs1
-rw-r--r--src/main.rs2
2 files changed, 2 insertions, 1 deletions
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()?;