Skip to content

Commit fd5dc78

Browse files
authored
refactor: cleanup and remove unused tauri::api modules (#7352)
1 parent 43c6285 commit fd5dc78

File tree

8 files changed

+13
-472
lines changed

8 files changed

+13
-472
lines changed

.changes/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"pref": "Performance Improvements",
99
"changes": "What's Changed",
1010
"sec": "Security fixes",
11-
"deps": "Dependencies"
11+
"deps": "Dependencies",
12+
"breaking": "Breaking Changes"
1213
},
1314
"defaultChangeTag": "changes",
1415
"pkgManagers": {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri': 'patch:breaking'
3+
---
4+
5+
- Removed `tauri::api::file` and `tauri::api::dir` modules, use `std::fs` instead.
6+
- Removed `tauri::api::version` module, use `semver` crate instead.

core/tauri/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ tauri-macros = { version = "2.0.0-alpha.6", path = "../tauri-macros" }
5252
tauri-utils = { version = "2.0.0-alpha.6", features = [ "resources" ], path = "../tauri-utils" }
5353
tauri-runtime-wry = { version = "0.13.0-alpha.6", path = "../tauri-runtime-wry", optional = true }
5454
rand = "0.8"
55-
semver = { version = "1.0", features = [ "serde" ] }
5655
serde_repr = "0.1"
5756
state = "0.6"
58-
tempfile = "3"
5957
http = "0.2"
6058
dirs-next = "2.0"
6159
percent-encoding = "2.2"

core/tauri/src/api/dir.rs

Lines changed: 0 additions & 238 deletions
This file was deleted.

core/tauri/src/api/error.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

5-
/// The error types.
5+
/// The result type of Tauri API module.
6+
pub type Result<T> = std::result::Result<T, Error>;
7+
8+
/// The error type of Tauri API module.
69
#[derive(thiserror::Error, Debug)]
710
#[non_exhaustive]
811
pub enum Error {
9-
/// Semver error.
10-
#[error(transparent)]
11-
Semver(#[from] semver::Error),
1212
/// JSON error.
1313
#[error(transparent)]
1414
Json(#[from] serde_json::Error),
15-
/// IO error.
16-
#[error(transparent)]
17-
Io(#[from] std::io::Error),
1815
}

core/tauri/src/api/file.rs

Lines changed: 0 additions & 85 deletions
This file was deleted.

core/tauri/src/api/mod.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@
44

55
//! The Tauri API interface.
66
7-
pub mod dir;
8-
pub mod file;
97
pub mod ipc;
10-
pub mod version;
118

129
mod error;
1310

14-
/// The error type of Tauri API module.
15-
pub use error::Error;
16-
/// The result type of Tauri API module.
17-
pub type Result<T> = std::result::Result<T, Error>;
18-
11+
pub use error::{Error, Result};
1912
// Not public API
2013
#[doc(hidden)]
2114
pub mod private {

0 commit comments

Comments
 (0)