diff --git a/src/bin/mangen.rs b/src/bin/mangen.rs index b348003..11ef22f 100644 --- a/src/bin/mangen.rs +++ b/src/bin/mangen.rs @@ -16,7 +16,7 @@ use std::path::PathBuf; /// See fn main() -> Result<()> { let out_dir = env::var("OUT_DIR").expect("OUT_DIR is not set"); - let out_path = PathBuf::from(out_dir).join(format!("{}.1", env!("CARGO_PKG_NAME"))); + let out_path = PathBuf::from(out_dir).join(concat!(env!("CARGO_PKG_NAME"), ".1")); let app = CliArgs::command(); let man = Man::new(app); let mut buffer = Vec::::new(); diff --git a/src/config.rs b/src/config.rs index 63ce5fe..6060ea4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -82,7 +82,7 @@ impl Config { #[inline(always)] fn get_default_locations() -> Option> { if let Some(config_dir) = dirs::config_dir() { - let file_name = format!("{}.toml", env!("CARGO_PKG_NAME")); + let file_name = concat!(env!("CARGO_PKG_NAME"), ".toml"); return Some(vec![ config_dir.join(&file_name), config_dir.join(env!("CARGO_PKG_NAME")).join(&file_name), // XDG style @@ -132,7 +132,7 @@ mod tests { fn test_parse_config() -> Result<()> { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("config") - .join(format!("{}.toml", env!("CARGO_PKG_NAME"))); + .join(concat!(env!("CARGO_PKG_NAME"), ".toml")); if let Some(global_path) = Config::get_default_location() { path = global_path; } diff --git a/src/helper/args/mod.rs b/src/helper/args/mod.rs index 043840b..1ad07d7 100644 --- a/src/helper/args/mod.rs +++ b/src/helper/args/mod.rs @@ -140,7 +140,7 @@ mod tests { PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("target") .join("debug") - .join(format!("{}-test", env!("CARGO_PKG_NAME"))) + .join(concat!(env!("CARGO_PKG_NAME"), "-test")) .to_string_lossy() .to_string() } diff --git a/tests/integration.rs b/tests/integration.rs index 513c4e4..e587480 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -14,7 +14,7 @@ fn get_argument_help() -> Result<()> { config: Some( PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("config") - .join(format!("{}.toml", env!("CARGO_PKG_NAME"))), + .join(concat!(env!("CARGO_PKG_NAME"), ".toml")), ), ..Default::default() };