From 0c11023bcf6cd300a7e32be340676d5785dd2267 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 19 Apr 2023 16:17:41 -0700 Subject: [PATCH] refactor(core): remove http-multipart Cargo feature (#6748) --- .github/workflows/lint-fmt-core.yml | 2 +- .github/workflows/test-core.yml | 2 +- core/tauri/Cargo.toml | 2 -- core/tauri/src/api/error.rs | 3 --- core/tauri/src/lib.rs | 2 -- examples/api/src-tauri/Cargo.lock | 20 -------------------- examples/api/src-tauri/Cargo.toml | 1 - 7 files changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/lint-fmt-core.yml b/.github/workflows/lint-fmt-core.yml index 133d6147af9..741b2237958 100644 --- a/.github/workflows/lint-fmt-core.yml +++ b/.github/workflows/lint-fmt-core.yml @@ -50,7 +50,7 @@ jobs: clippy: - { args: '', key: 'empty' } - { - args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,updater,system-tray,http-multipart', + args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,updater,system-tray', key: 'all' } - { args: '--features custom-protocol', key: 'custom-protocol' } diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 0a08c7d29ea..d7cdf3e117d 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -76,7 +76,7 @@ jobs: key: api-all } - { - args: --features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,updater,system-tray,http-multipart, + args: --features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,updater,system-tray, key: all } diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 42b91ff53da..15325f50c19 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -23,7 +23,6 @@ features = [ "fs-extract-api", "system-tray", "devtools", - "http-multipart", "icon-png", "dox" ] @@ -142,7 +141,6 @@ updater = [ "dialog-ask", "fs-extract-api" ] -http-multipart = [ "reqwest/multipart" ] shell-open-api = [ "open", "regex", "tauri-macros/shell-scope" ] fs-extract-api = [ "zip" ] native-tls = [ "reqwest/native-tls" ] diff --git a/core/tauri/src/api/error.rs b/core/tauri/src/api/error.rs index c51de40a78e..8143360735d 100644 --- a/core/tauri/src/api/error.rs +++ b/core/tauri/src/api/error.rs @@ -21,9 +21,6 @@ pub enum Error { /// The dialog operation was cancelled by the user. #[error("user cancelled the dialog")] DialogCancelled, - /// The network error. - #[error("Network Error: {0}")] - Network(#[from] reqwest::Error), /// Invalid HTTP header value. #[error(transparent)] HttpHeaderValue(#[from] http::header::InvalidHeaderValue), diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index e7a1dda10ba..58d7007a8f2 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -20,7 +20,6 @@ //! - **devtools**: Enables the developer tools (Web inspector) and [`Window::open_devtools`]. Enabled by default on debug builds. //! On macOS it uses private APIs, so you can't enable it if your app will be published to the App Store. //! - **shell-open-api**: Enables the [`api::shell`] module. -//! - **http-multipart**: Adds support to `multipart/form-data` requests. //! - **native-tls**: Provides TLS support to connect over HTTPS. //! - **native-tls-vendored**: Compile and statically link to a vendored copy of OpenSSL. //! - **rustls-tls**: Provides TLS support to connect over HTTPS using rustls. @@ -992,7 +991,6 @@ mod tests { // features that look like an allowlist feature, but are not let allowed = [ "fs-extract-api", - "http-multipart", "process-command-api", "process-relaunch-dangerous-allow-symlink-macos", "window-data-url", diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 68e7af1fd20..8067de5af81 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -1747,16 +1747,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minisign-verify" version = "0.2.1" @@ -2446,7 +2436,6 @@ dependencies = [ "js-sys", "log", "mime", - "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", @@ -3446,15 +3435,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.10" diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 7d2e0a68fa1..60804e631e4 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -35,7 +35,6 @@ tauri-build = { path = "../../../core/tauri-build" } path = "../../../core/tauri" features = [ "api-all", - "http-multipart", "icon-ico", "icon-png", "isolation",