From e3e47b2630a3749d7b4baeeb718af7b25b85ddf0 Mon Sep 17 00:00:00 2001
From: Brian Lewis <keller@csh.rit.edu>
Date: Fri, 18 Mar 2022 15:17:16 +0100
Subject: [PATCH] Move magic values into constants

---
 freva-ingest/src/main.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/freva-ingest/src/main.rs b/freva-ingest/src/main.rs
index b605d12..5597b12 100644
--- a/freva-ingest/src/main.rs
+++ b/freva-ingest/src/main.rs
@@ -8,6 +8,10 @@ use cli::Cli;
 use config::{config, drs_config};
 use directories::ProjectDirs;
 
+const DOMAIN: &str = "de";
+const ORGANIZATION: &str = "DKRZ";
+const APP_NAME: &str = "freva";
+
 #[tokio::main]
 async fn main() -> Result<()> {
     let args = Cli::try_parse()?;
@@ -22,7 +26,7 @@ async fn main() -> Result<()> {
 
     let config_dir = match args.config_dir {
         Some(c) => c,
-        None => ProjectDirs::from("de", "DKRZ", "freva")
+        None => ProjectDirs::from(DOMAIN, ORGANIZATION, APP_NAME)
             .context("no config dir given and no valid home directory found")?
             .config_dir()
             .to_owned(),
-- 
GitLab