🚧 Restore use of concat_string! macro name
This commit is contained in:
parent
bf150d206f
commit
346dac7713
3 changed files with 10 additions and 10 deletions
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
// RE-EXPORTED *************************************************************************************
|
// RE-EXPORTED *************************************************************************************
|
||||||
|
|
||||||
pub use concat_string::concat_string as join;
|
pub use concat_string::concat_string;
|
||||||
|
|
||||||
/// Enables flexible identifier concatenation in macros, allowing new items with pasted identifiers.
|
/// Enables flexible identifier concatenation in macros, allowing new items with pasted identifiers.
|
||||||
pub use paste::paste;
|
pub use paste::paste;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// RE-EXPORTED.
|
// RE-EXPORTED.
|
||||||
|
|
||||||
pub use crate::{join, main, paste, test};
|
pub use crate::{concat_string, main, paste, test};
|
||||||
|
|
||||||
pub use crate::{AutoDefault, StaticResources, TypeId, Weight};
|
pub use crate::{AutoDefault, StaticResources, TypeId, Weight};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//! Retrieve settings values from configuration files.
|
//! Retrieve settings values from configuration files.
|
||||||
|
|
||||||
use crate::join;
|
use crate::concat_string;
|
||||||
use crate::util::data::ConfigData;
|
use crate::util::data::ConfigData;
|
||||||
use crate::util::file::File;
|
use crate::util::file::File;
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ pub static CONFIG_DATA: LazyLock<ConfigData> = LazyLock::new(|| {
|
||||||
.unwrap_or_else(|_| "config".to_string());
|
.unwrap_or_else(|_| "config".to_string());
|
||||||
|
|
||||||
// Execution mode based on the environment variable PAGETOP_RUN_MODE, defaults to 'default'.
|
// Execution mode based on the environment variable PAGETOP_RUN_MODE, defaults to 'default'.
|
||||||
let run_mode = env::var("PAGETOP_RUN_MODE").unwrap_or_else(|_| "default".into());
|
let rm = env::var("PAGETOP_RUN_MODE").unwrap_or_else(|_| "default".into());
|
||||||
|
|
||||||
// Initialize settings.
|
// Initialize settings.
|
||||||
let mut settings = ConfigData::default();
|
let mut settings = ConfigData::default();
|
||||||
|
|
@ -32,19 +32,19 @@ pub static CONFIG_DATA: LazyLock<ConfigData> = LazyLock::new(|| {
|
||||||
// Merge (optional) configuration files and set the execution mode.
|
// Merge (optional) configuration files and set the execution mode.
|
||||||
settings
|
settings
|
||||||
// First, add the common configuration for all environments. Defaults to 'common.toml'.
|
// First, add the common configuration for all environments. Defaults to 'common.toml'.
|
||||||
.merge(File::with_name(&join!(config_dir, "/common.toml")).required(false))
|
.merge(File::with_name(&concat_string!(config_dir, "/common.toml")).required(false))
|
||||||
.expect("Failed to merge common configuration (common.toml)")
|
.expect("Failed to merge common configuration (common.toml)")
|
||||||
// Add the environment-specific configuration. Defaults to 'default.toml'.
|
// Add the environment-specific configuration. Defaults to 'default.toml'.
|
||||||
.merge(File::with_name(&join!(config_dir, "/", run_mode, ".toml")).required(false))
|
.merge(File::with_name(&concat_string!(config_dir, "/", rm, ".toml")).required(false))
|
||||||
.expect(&format!("Failed to merge {run_mode}.toml configuration"))
|
.expect(&format!("Failed to merge {rm}.toml configuration"))
|
||||||
// Add reserved local configuration for the environment. Defaults to 'local.default.toml'.
|
// Add reserved local configuration for the environment. Defaults to 'local.default.toml'.
|
||||||
.merge(File::with_name(&join!(config_dir, "/local.", run_mode, ".toml")).required(false))
|
.merge(File::with_name(&concat_string!(config_dir, "/local.", rm, ".toml")).required(false))
|
||||||
.expect("Failed to merge reserved local environment configuration")
|
.expect("Failed to merge reserved local environment configuration")
|
||||||
// Add the general reserved local configuration. Defaults to 'local.toml'.
|
// Add the general reserved local configuration. Defaults to 'local.toml'.
|
||||||
.merge(File::with_name(&join!(config_dir, "/local.toml")).required(false))
|
.merge(File::with_name(&concat_string!(config_dir, "/local.toml")).required(false))
|
||||||
.expect("Failed to merge general reserved local configuration")
|
.expect("Failed to merge general reserved local configuration")
|
||||||
// Save the execution mode.
|
// Save the execution mode.
|
||||||
.set("app.run_mode", run_mode)
|
.set("app.run_mode", rm)
|
||||||
.expect("Failed to set application run mode");
|
.expect("Failed to set application run mode");
|
||||||
|
|
||||||
settings
|
settings
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue