Skip to content

Commit

Permalink
fix: schemars 0.8.18 compatibility (#9680)
Browse files Browse the repository at this point in the history
* fix: schemars 0.8.18 compatibility

backport of #9676

Co-authored-by: Hankung <73242257+Hankung7183@users.noreply.github.com>

* fix clippy lol

---------

Co-authored-by: Hankung <73242257+Hankung7183@users.noreply.github.com>
  • Loading branch information
FabianLars and Hankung7183 authored May 6, 2024
1 parent b8fd8e1 commit 5ee5ed4
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 42 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions .changes/schemars-comp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri-utils: "patch:bug"
---

Fixes `schemars` compilation issue.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/tauri-config-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
tauri-utils = { version = "1.0.0", features = [
"schema",
], path = "../tauri-utils" }
schemars = { version = "0.8", features = ["url", "preserve_order"] }
schemars = { version = "0.8.18", features = ["url", "preserve_order"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
url = { version = "2.3", features = ["serde"] }
1 change: 0 additions & 1 deletion core/tauri-config-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
},
"version": {
"description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.",
"default": null,
"type": [
"string",
"null"
Expand Down
2 changes: 1 addition & 1 deletion core/tauri-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ html5ever = "0.26"
kuchiki = { package = "kuchikiki", version = "0.8" }
proc-macro2 = { version = "1", optional = true }
quote = { version = "1", optional = true }
schemars = { version = "0.8", features = [ "url" ], optional = true }
schemars = { version = "0.8.18", features = [ "url" ], optional = true }
serde_with = "3"
aes-gcm = { version = "0.10", optional = true }
getrandom = { version = "0.2", optional = true, features = [ "std" ] }
Expand Down
14 changes: 4 additions & 10 deletions core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,13 @@ impl schemars::JsonSchema for BundleTarget {
..Default::default()
}
.into(),
schemars::_private::apply_metadata(
schemars::_private::metadata::add_description(
gen.subschema_for::<Vec<BundleType>>(),
schemars::schema::Metadata {
description: Some("A list of bundle targets.".to_owned()),
..Default::default()
},
"A list of bundle targets.",
),
schemars::_private::apply_metadata(
schemars::_private::metadata::add_description(
gen.subschema_for::<BundleType>(),
schemars::schema::Metadata {
description: Some("A single bundle target.".to_owned()),
..Default::default()
},
"A single bundle target.",
),
];

Expand Down
6 changes: 3 additions & 3 deletions core/tauri/src/async_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl GlobalRuntime {
}
}

fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output>
fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static,
Expand Down Expand Up @@ -96,7 +96,7 @@ impl Runtime {
}

/// Spawns a future onto the runtime.
pub fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output>
pub fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static,
Expand Down Expand Up @@ -189,7 +189,7 @@ impl RuntimeHandle {
}

/// Spawns a future onto the runtime.
pub fn spawn<F: Future>(&self, task: F) -> JoinHandle<F::Output>
pub fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static,
Expand Down
16 changes: 8 additions & 8 deletions tooling/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "tauri-cli"
version = "1.5.12"
authors = [ "Tauri Programme within The Commons Conservancy" ]
edition = "2021"
rust-version = "1.60"
rust-version = "1.70"
categories = [ "gui", "web-programming" ]
license = "Apache-2.0 OR MIT"
homepage = "https://tauri.app"
Expand Down
1 change: 0 additions & 1 deletion tooling/cli/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
},
"version": {
"description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.",
"default": null,
"type": [
"string",
"null"
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
}

if options.runner.is_none() {
options.runner = config_.build.runner.clone();
options.runner.clone_from(&config_.build.runner);
}

options
Expand Down
9 changes: 2 additions & 7 deletions tooling/cli/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,9 @@ fn command_internal(mut options: Options) -> Result<()> {
}

if options.runner.is_none() {
options.runner = config
.lock()
.unwrap()
.as_ref()
.unwrap()
.build
options
.runner
.clone();
.clone_from(&config.lock().unwrap().as_ref().unwrap().build.runner);
}

let mut cargo_features = config
Expand Down

0 comments on commit 5ee5ed4

Please sign in to comment.