Skip to content

Commit 3f24109

Browse files
committed
refactor: extract constants for data and build directory names
Extract DATA_DIR_NAME and BUILD_DIR_NAME constants in internal_config.rs to eliminate magic strings. These constants define the base directory names for user data and build artifacts respectively.
1 parent 2c5f8a5 commit 3f24109

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/domain/environment/internal_config.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ use crate::domain::environment::EnvironmentName;
2222
use serde::{Deserialize, Serialize};
2323
use std::path::PathBuf;
2424

25+
/// Base directory name for user data
26+
const DATA_DIR_NAME: &str = "data";
27+
28+
/// Base directory name for build artifacts
29+
const BUILD_DIR_NAME: &str = "build";
30+
2531
/// Internal paths and configuration derived from user inputs
2632
///
2733
/// This struct contains fields that are derived automatically from user inputs
@@ -78,8 +84,8 @@ impl InternalConfig {
7884
#[must_use]
7985
pub fn new(env_name: &EnvironmentName) -> Self {
8086
// Generate environment-specific directories
81-
let data_dir = PathBuf::from("data").join(env_name.as_str());
82-
let build_dir = PathBuf::from("build").join(env_name.as_str());
87+
let data_dir = PathBuf::from(DATA_DIR_NAME).join(env_name.as_str());
88+
let build_dir = PathBuf::from(BUILD_DIR_NAME).join(env_name.as_str());
8389

8490
Self {
8591
build_dir,

0 commit comments

Comments
 (0)