diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 2ea33b3a6..f32225710 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -63,7 +63,7 @@ notify-rust = { version = "4.5", optional = true } reqwest = { version = "0.11", features = [ "json", "multipart" ], optional = true } bytes = { version = "1", features = [ "serde" ], optional = true } attohttpc = { version = "0.17", features = [ "json", "form" ] } -open = { version = "1.7", optional = true } +open = { version = "2.0", optional = true } shared_child = { version = "0.3", optional = true } os_pipe = { version = "0.9", optional = true } rfd = "0.4.1" diff --git a/core/tauri/src/api/shell.rs b/core/tauri/src/api/shell.rs index 5acb5de99..19204d87c 100644 --- a/core/tauri/src/api/shell.rs +++ b/core/tauri/src/api/shell.rs @@ -10,18 +10,7 @@ pub fn open(path: String, with: Option) -> crate::api::Result<()> { } else { open::that(&path) }; - match exit_status { - Ok(status) => { - if status.success() { - Ok(()) - } else { - Err(crate::api::Error::Shell("open command failed".into())) - } - } - Err(err) => Err(crate::api::Error::Shell(format!( - "failed to open: {}", - err.to_string() - ))), - } + exit_status + .map_err(|err| crate::api::Error::Shell(format!("failed to open: {}", err.to_string()))) } }