Skip to content

Commit

Permalink
fix: clippy warnings, add missing wry feature on examples (#1604)
Browse files Browse the repository at this point in the history
* fix: clippy warnings, add missing wry feature on examples

* schema feat does not exist

* also add compression
  • Loading branch information
lucasfernog authored Jul 31, 2024
1 parent e847ced commit 95da90f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 21 deletions.
8 changes: 5 additions & 3 deletions examples/api/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.8" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.8" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.9" }

[dependencies.tauri]
workspace = true
features = [
[dependencies.tauri]
workspace = true
features = [
"wry",
"compression",
"image-ico",
"image-png",
"isolation",
Expand Down
14 changes: 14 additions & 0 deletions examples/api/src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6754,6 +6754,13 @@
"window:allow-set-size"
]
},
{
"description": "window:allow-set-size-constraints -> Enables the set_size_constraints command without any pre-configured scope.",
"type": "string",
"enum": [
"window:allow-set-size-constraints"
]
},
{
"description": "window:allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -7202,6 +7209,13 @@
"window:deny-set-size"
]
},
{
"description": "window:deny-set-size-constraints -> Denies the set_size_constraints command without any pre-configured scope.",
"type": "string",
"enum": [
"window:deny-set-size-constraints"
]
},
{
"description": "window:deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.",
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion plugins/deep-link/examples/app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tauri-build = { workspace = true }
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
tauri = { workspace = true }
tauri = { workspace = true, features = ["wry", "compression"] }
tauri-plugin-deep-link = { path = "../../../" }

[features]
Expand Down
4 changes: 2 additions & 2 deletions plugins/notification/src/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ mod imp {
///
/// - **Windows**: Not supported on Windows 7. If your app targets it, enable the `windows7-compat` feature and use [`Self::notify`].
#[cfg_attr(
all(not(doc_cfg), feature = "windows7-compat"),
all(not(docsrs), feature = "windows7-compat"),
deprecated = "This function does not work on Windows 7. Use `Self::notify` instead."
)]
pub fn show(self) -> crate::Result<()> {
Expand Down Expand Up @@ -220,7 +220,7 @@ mod imp {
/// .expect("error while running tauri application");
/// ```
#[cfg(feature = "windows7-compat")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "windows7-compat")))]
#[cfg_attr(docsrs, doc(cfg(feature = "windows7-compat")))]
#[allow(unused_variables)]
pub fn notify<R: tauri::Runtime>(self, app: &tauri::AppHandle<R>) -> crate::Result<()> {
#[cfg(windows)]
Expand Down
2 changes: 2 additions & 0 deletions plugins/notification/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ impl ActiveNotification {
}
}

#[cfg(mobile)]
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ActionType {
Expand All @@ -364,6 +365,7 @@ pub struct ActionType {
hidden_previews_show_subtitle: bool,
}

#[cfg(mobile)]
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rust-version = "1.75"
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
tauri = { workspace = true }
tauri = { workspace = true, features = ["wry", "compression"] }
tauri-plugin-single-instance = { path = "../../../" }
tauri-plugin-cli = { path = "../../../../cli" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2021"
tauri-build = { workspace = true }

[dependencies]
tauri = { workspace = true }
tauri = { workspace = true, features = ["wry", "compression"] }
serde = { workspace = true }
serde_json = { workspace = true }
tauri-plugin-store = { path = "../../../" }
Expand Down
21 changes: 10 additions & 11 deletions plugins/updater/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,17 @@ impl<'de> Deserialize<'de> for UpdaterEndpoint {
D: Deserializer<'de>,
{
let url = Url::deserialize(deserializer)?;
#[cfg(not(feature = "schema"))]
{
if url.scheme() != "https" {
#[cfg(debug_assertions)]
eprintln!("[\x1b[33mWARNING\x1b[0m] The configured updater endpoint doesn't use `https` protocol. This is allowed in development but will fail in release builds.");

#[cfg(not(debug_assertions))]
return Err(serde::de::Error::custom(
"The configured updater endpoint must use the `https` protocol.",
));
}

if url.scheme() != "https" {
#[cfg(debug_assertions)]
eprintln!("[\x1b[33mWARNING\x1b[0m] The configured updater endpoint doesn't use `https` protocol. This is allowed in development but will fail in release builds.");

#[cfg(not(debug_assertions))]
return Err(serde::de::Error::custom(
"The configured updater endpoint must use the `https` protocol.",
));
}

Ok(Self(url))
}
}
2 changes: 1 addition & 1 deletion plugins/updater/tests/app-updater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = { workspace = true }
tauri-build = { workspace = true }

[dependencies]
tauri = { workspace = true }
tauri = { workspace = true, features = ["wry", "compression"] }
serde = { workspace = true }
serde_json = { workspace = true }
tauri-plugin-updater = { path = "../.." }
Expand Down
2 changes: 1 addition & 1 deletion plugins/websocket/examples/tauri-app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
tauri = { workspace = true }
tauri = { workspace = true, features = ["wry", "compression"] }
tokio = { version = "1", features = ["net"] }
futures-util = "0.3"
tauri-plugin-websocket = { path = "../../../" }
Expand Down

0 comments on commit 95da90f

Please sign in to comment.