From 0f310e75ed20b6dd37e24701501a4ea8a9c0efef Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 14:57:41 +0100 Subject: [PATCH] fix --- plugins/opener/src/open.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/opener/src/open.rs b/plugins/opener/src/open.rs index fe721f9c..2a1321a5 100644 --- a/plugins/opener/src/open.rs +++ b/plugins/opener/src/open.rs @@ -9,14 +9,14 @@ use std::{ffi::OsStr, path::Path}; pub(crate) fn open, S: AsRef>(path: P, with: Option) -> crate::Result<()> { match with { Some(program) => ::open::with_detached(path, program.as_ref()), + #[cfg(target_os = "linux")] None => { // ref https://github.com/tauri-apps/tauri/issues/10617 - #[cfg(target_os = "linux")] - return ::open::with_detached(&path, "/usr/bin/xdg-open") - .or_else(|_| ::open::that_detached(path)); - #[cfg(not(target_os = "linux"))] - ::open::that_detached(path) + ::open::with_detached(&path, "/usr/bin/xdg-open") + .or_else(|_| ::open::that_detached(path)) } + #[cfg(not(target_os = "linux"))] + None => ::open::that_detached(path), } .map_err(Into::into) }