Skip to content

Commit

Permalink
refactor: cleanup and remove unused tauri::api modules (#7352)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Jul 10, 2023
1 parent 43c6285 commit fd5dc78
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 472 deletions.
3 changes: 2 additions & 1 deletion .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"pref": "Performance Improvements",
"changes": "What's Changed",
"sec": "Security fixes",
"deps": "Dependencies"
"deps": "Dependencies",
"breaking": "Breaking Changes"
},
"defaultChangeTag": "changes",
"pkgManagers": {
Expand Down
6 changes: 6 additions & 0 deletions .changes/core-remove-file-dir-semver-apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri': 'patch:breaking'
---

- Removed `tauri::api::file` and `tauri::api::dir` modules, use `std::fs` instead.
- Removed `tauri::api::version` module, use `semver` crate instead.
2 changes: 0 additions & 2 deletions core/tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ tauri-macros = { version = "2.0.0-alpha.6", path = "../tauri-macros" }
tauri-utils = { version = "2.0.0-alpha.6", features = [ "resources" ], path = "../tauri-utils" }
tauri-runtime-wry = { version = "0.13.0-alpha.6", path = "../tauri-runtime-wry", optional = true }
rand = "0.8"
semver = { version = "1.0", features = [ "serde" ] }
serde_repr = "0.1"
state = "0.6"
tempfile = "3"
http = "0.2"
dirs-next = "2.0"
percent-encoding = "2.2"
Expand Down
238 changes: 0 additions & 238 deletions core/tauri/src/api/dir.rs

This file was deleted.

11 changes: 4 additions & 7 deletions core/tauri/src/api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

/// The error types.
/// The result type of Tauri API module.
pub type Result<T> = std::result::Result<T, Error>;

/// The error type of Tauri API module.
#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum Error {
/// Semver error.
#[error(transparent)]
Semver(#[from] semver::Error),
/// JSON error.
#[error(transparent)]
Json(#[from] serde_json::Error),
/// IO error.
#[error(transparent)]
Io(#[from] std::io::Error),
}
85 changes: 0 additions & 85 deletions core/tauri/src/api/file.rs

This file was deleted.

9 changes: 1 addition & 8 deletions core/tauri/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,11 @@

//! The Tauri API interface.

pub mod dir;
pub mod file;
pub mod ipc;
pub mod version;

mod error;

/// The error type of Tauri API module.
pub use error::Error;
/// The result type of Tauri API module.
pub type Result<T> = std::result::Result<T, Error>;

pub use error::{Error, Result};
// Not public API
#[doc(hidden)]
pub mod private {
Expand Down
Loading

0 comments on commit fd5dc78

Please sign in to comment.