From a6d231df48472b561986ddd36ae6d55035b3cc44 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Aug 2021 20:28:26 -0300 Subject: [PATCH] chore(deps) Update Rust crate open to v2 (#2306) * chore(deps) Update Rust crate open to v2 * fix build Co-authored-by: Renovate Bot Co-authored-by: Lucas Nogueira --- core/tauri/Cargo.toml | 2 +- core/tauri/src/api/shell.rs | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) 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()))) } }