Skip to content

Commit e087f0f

Browse files
authored
feat: add #[non_exhaustive] attribute (#1725)
1 parent 6bfac86 commit e087f0f

File tree

30 files changed

+58
-62
lines changed

30 files changed

+58
-62
lines changed

.changes/non-exhaustive.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"tauri": patch
3+
"tauri-bundler": patch
4+
"tauri-codegen": patch
5+
"tauri-utils": patch
6+
---
7+
8+
Added the `#[non_exhaustive] attribute where appropriate.

.changes/remove-api-modules.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+
Removed the `tcp` module from `tauri::api`.

.changes/setup-error-send.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+
The `setup` Error type must be `Send`.

core/tauri-codegen/src/embedded_assets.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type Asset = (AssetKey, (PathBuf, PathBuf));
2525

2626
/// All possible errors while reading and compressing an [`EmbeddedAssets`] directory
2727
#[derive(Debug, Error)]
28+
#[non_exhaustive]
2829
pub enum EmbeddedAssetsError {
2930
#[error("failed to read asset at {path} because {error}")]
3031
AssetRead {

core/tauri-codegen/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub mod embedded_assets;
1717

1818
/// Represents all the errors that can happen while reading the config.
1919
#[derive(Debug, Error)]
20+
#[non_exhaustive]
2021
pub enum ConfigError {
2122
#[error("unable to access current working directory: {0}")]
2223
CurrentDir(std::io::Error),

core/tauri-utils/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ edition = "2018"
1111
[dependencies]
1212
serde = { version = "1.0", features = [ "derive" ] }
1313
serde_json = "1.0"
14-
sysinfo = "0.17"
1514
thiserror = "1.0.24"
1615
phf = { version = "0.8", features = [ "macros" ] }
1716
zstd = "0.8"

core/tauri-utils/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use url::Url;
1111
/// The window webview URL options.
1212
#[derive(PartialEq, Debug, Clone, Deserialize)]
1313
#[serde(untagged)]
14+
#[non_exhaustive]
1415
pub enum WindowUrl {
1516
/// An external URL.
1617
External(Url),

core/tauri-utils/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ pub mod config;
1313
pub mod html;
1414
/// Platform helpers
1515
pub mod platform;
16-
/// Process helpers
17-
pub mod process;
1816

1917
/// Result type alias using the crate's error type.
2018
pub type Result<T> = std::result::Result<T, Error>;
2119

2220
/// The error types.
2321
#[derive(Debug, thiserror::Error)]
22+
#[non_exhaustive]
2423
pub enum Error {
2524
/// Target triple architecture error
2625
#[error("Unable to determine target-architecture")]

core/tauri-utils/src/process.rs

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

core/tauri/src/api/cli.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mod macros;
1616

1717
/// The resolution of a arg match.
1818
#[derive(Default, Debug, Serialize)]
19+
#[non_exhaustive]
1920
pub struct ArgData {
2021
/// The value of the arg.
2122
/// - Value::Bool if it's a flag,
@@ -30,6 +31,7 @@ pub struct ArgData {
3031

3132
/// The matched subcommand.
3233
#[derive(Default, Debug, Serialize)]
34+
#[non_exhaustive]
3335
pub struct SubcommandMatches {
3436
/// The subcommand name.
3537
pub name: String,
@@ -39,6 +41,7 @@ pub struct SubcommandMatches {
3941

4042
/// The arg matches of a command.
4143
#[derive(Default, Debug, Serialize)]
44+
#[non_exhaustive]
4245
pub struct Matches {
4346
/// Data structure mapping each found arg with its resolution.
4447
pub args: HashMap<String, ArgData>,

0 commit comments

Comments
 (0)