From de2141347eda72fe43bf9016ebe60c185985800f Mon Sep 17 00:00:00 2001 From: ObsoleteDev <91698052+obsoletedevgit@users.noreply.github.com> Date: Tue, 21 Oct 2025 12:25:48 +0100 Subject: [PATCH] Fix: Hyfetch panics on some distros that are not defined (#455) --- crates/hyfetch/src/bin/hyfetch.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/hyfetch/src/bin/hyfetch.rs b/crates/hyfetch/src/bin/hyfetch.rs index d680c6b6..1abcf3f7 100644 --- a/crates/hyfetch/src/bin/hyfetch.rs +++ b/crates/hyfetch/src/bin/hyfetch.rs @@ -781,8 +781,11 @@ fn create_config( // get distro string and convert it into the enum, neofetch friendly format, so we can check for small logos with the {distro}_small neofetch naming scheme. let tmp_dst = get_distro_name(backend).or_else(|_| get_distro_name(Backend::Neofetch)).context("failed to get distro name")?; let detected_dst = Some(distro.map_or_else( - || format!("{:?}", Distro::detect(tmp_dst).unwrap()), - |d| d.to_string(), + || { + Distro::detect(&tmp_dst) + .map_or("".to_string(), |d| format!("{:?}", d).to_lowercase()) + }, + |d| d.to_string().to_lowercase(), )); // in case someone specified {distro}_small already in the --distro arg