summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-10-30 11:46:00 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-10-30 11:46:00 -0400
commit4bded39db9a5e07dca7bee97201b0e90faf4af5c (patch)
tree801dad66c324b47e6eb496bc57eb565f3659ecc9 /src/main.rs
parent10f694a74976a85e0f5da8ee382878f0ffbb4ec4 (diff)
move string into constant
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index ddfc5af..e28e05a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,6 +28,7 @@ use crate::error::JoshutoError;
use crate::run::run;
const PROGRAM_NAME: &str = "joshuto";
+const CONFIG_HOME: &str = "JOSHUTO_CONFIG_HOME";
const CONFIG_FILE: &str = "joshuto.toml";
const MIMETYPE_FILE: &str = "mimetype.toml";
const KEYMAP_FILE: &str = "keymap.toml";
@@ -39,7 +40,7 @@ lazy_static! {
static ref CONFIG_HIERARCHY: Vec<PathBuf> = {
let mut config_dirs = vec![];
- if let Ok(p) = std::env::var("JOSHUTO_CONFIG_HOME") {
+ if let Ok(p) = std::env::var(CONFIG_HOME) {
let p = PathBuf::from(p);
if p.is_dir() {
config_dirs.push(p);