From f4a8461ac725e8a9b77457e254f965222fee6222 Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Thu, 20 May 2021 12:41:55 +0300 Subject: [PATCH] fix(#7): cannot found XDG_SESSION_TYPE --- src/ffmpeg_interface.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ffmpeg_interface.rs b/src/ffmpeg_interface.rs index 69e4e42..ed14a11 100644 --- a/src/ffmpeg_interface.rs +++ b/src/ffmpeg_interface.rs @@ -463,10 +463,10 @@ impl Ffmpeg { fn is_wayland() -> bool { std::env::var("XDG_SESSION_TYPE") - .unwrap() + .unwrap_or_default() .eq_ignore_ascii_case("wayland") } fn is_snap() -> bool { - std::env::var("SNAP").unwrap_or(String::new()).len() > 0 + std::env::var("SNAP").unwrap_or_default().len() > 0 }