Skip to content

Commit f7d3d93

Browse files
authored
refactor(core): improve performance of the extract API (#3963)
1 parent edf85bc commit f7d3d93

7 files changed

Lines changed: 212 additions & 186 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
**Breaking change:** Removed `tauri::api::file::ArchiveFormat::Plain`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
**Breaking change:** The `tauri::api::file::Extract#extract_file` function has been moved to `tauri::api::file::Entry#extract`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
**Breaking change:** The `tauri::api::file::Extract#files` function has been renamed to `with_files` for performance reasons.

.changes/extract-performance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Improved the performance of the `tauri::api::fs::Extract` API.

core/tauri/src/api/error.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ pub enum Error {
99
/// Command error.
1010
#[error("Command Error: {0}")]
1111
Command(String),
12-
/// The extract archive error.
13-
#[error("Extract Error: {0}")]
14-
Extract(String),
1512
/// The path operation error.
1613
#[error("Path Error: {0}")]
1714
Path(String),
@@ -69,6 +66,10 @@ pub enum Error {
6966
#[cfg(feature = "fs-extract-api")]
7067
#[error(transparent)]
7168
Zip(#[from] zip::result::ZipError),
69+
/// Extract error.
70+
#[cfg(feature = "fs-extract-api")]
71+
#[error("Failed to extract: {0}")]
72+
Extract(String),
7273
/// Notification error.
7374
#[cfg(notification_all)]
7475
#[error(transparent)]

0 commit comments

Comments
 (0)