git.lucas.co / cce-graph
node-based graph editor
git clone https://git.lucas.co/cce-graph.git

commit3c259acebed88a8a9a33dff2ef07f40e81f1caa5
parent4c0789f3b6
authorLucas Galante <[email protected]>
date2026-07-07 09:47
refactor: drop hardcoded /home/lsgalante HOME fallback

Replace env::var("HOME").unwrap_or_else(|_| "/home/lsgalante") with
.unwrap_or_default() — identical when $HOME is set, no hardcoded username.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

 src/main.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 26ca569..e6befd8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -86,11 +86,11 @@ fn get_default_project_path() -> std::path::PathBuf {
         if !xdg_config.is_empty() {
             std::path::PathBuf::from(xdg_config)
         } else {
-            let home = std::env::var("HOME").unwrap_or_else(|_| "/home/lsgalante".to_string());
+            let home = std::env::var("HOME").unwrap_or_default();
             std::path::PathBuf::from(home).join(".config")
         }
     } else {
-        let home = std::env::var("HOME").unwrap_or_else(|_| "/home/lsgalante".to_string());
+        let home = std::env::var("HOME").unwrap_or_default();
         std::path::PathBuf::from(home).join(".config")
     };
     dir.join("cce").join("cce-graph").join("default.kdl")