GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
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/layout.rs | 2 +-
src/widget/input/multi_control.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/layout.rs b/src/layout.rs
index 4e4e857..b8ba6ee 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -5201,7 +5201,7 @@ pub fn parse_font_for_alias(content: &str, alias: &str) -> Option<String> {
}
pub fn read_preferred_fonts() -> (String, String, String, String, String, String, String) {
- let home = std::env::var("HOME").unwrap_or_else(|_| "/home/lsgalante".to_string());
+ let home = std::env::var("HOME").unwrap_or_default();
let path = std::path::Path::new(&home).join(".config/fontconfig/fonts.conf");
let content = std::fs::read_to_string(&path).unwrap_or_default();
diff --git a/src/widget/input/multi_control.rs b/src/widget/input/multi_control.rs
index 395e2f3..0d0708c 100644
--- a/src/widget/input/multi_control.rs
+++ b/src/widget/input/multi_control.rs
@@ -965,7 +965,7 @@ fn get_application_config_path() -> std::path::PathBuf {
.parent()
.map(|p| p.to_path_buf())
.unwrap_or_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").join("cce")
});