From 7eb9aa75cfd6a3176d3f566fdda02d88aa529b0f Mon Sep 17 00:00:00 2001 From: "Ngo Iok Ui (Wu Yu Wei)" Date: Mon, 30 Jan 2023 02:08:27 +0800 Subject: [PATCH] Update gtk to 0.16 (#6155) Co-authored-by: Wu Yu Wei Co-authored-by: Lucas Nogueira --- .changes/config.json | 2 +- .changes/gtk16.md | 8 ++++++ .changes/msrv-1.64.md | 13 ++++++++++ .devcontainer/Dockerfile | 2 +- .docker/cross/aarch64.Dockerfile | 2 +- .github/workflows/artifacts-updater.yml | 2 +- .github/workflows/bench.yml | 2 +- .../workflows/covector-version-or-publish.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/lint-fmt-core.yml | 2 +- .github/workflows/publish-cli-js.yml | 4 +-- .github/workflows/test-cli-js.yml | 2 +- .github/workflows/test-core.yml | 12 ++++----- .github/workflows/test-mobile.yml | 2 +- .github/workflows/udeps.yml | 2 +- README.md | 2 +- core/tauri-build/Cargo.toml | 2 +- core/tauri-codegen/Cargo.toml | 2 +- core/tauri-macros/Cargo.toml | 2 +- core/tauri-runtime-wry/Cargo.toml | 8 +++--- core/tauri-runtime/Cargo.toml | 4 +-- core/tauri-utils/Cargo.toml | 2 +- core/tauri/Cargo.toml | 10 +++---- examples/api/src-tauri/Cargo.toml | 2 +- examples/commands/main.rs | 8 +++--- examples/resources/src-tauri/Cargo.toml | 2 +- examples/sidecar/src-tauri/Cargo.toml | 2 +- .../tauri-dynamic-lib/src-app1/Cargo.toml | 2 +- .../tauri-dynamic-lib/src-tauri/Cargo.toml | 2 +- examples/updater/src-tauri/Cargo.toml | 2 +- examples/web/core/tauri/Cargo.toml | 2 +- tooling/bench/Cargo.toml | 2 +- .../tests/cpu_intensive/src-tauri/Cargo.toml | 2 +- .../tests/files_transfer/src-tauri/Cargo.toml | 2 +- .../tests/helloworld/src-tauri/Cargo.toml | 2 +- tooling/bundler/Cargo.toml | 2 +- tooling/bundler/src/bundle/category.rs | 3 +-- tooling/bundler/src/bundle/common.rs | 20 +++++--------- tooling/bundler/src/bundle/linux/debian.rs | 26 +++++++++---------- tooling/bundler/src/bundle/path_utils.rs | 10 +++---- tooling/bundler/src/bundle/platform.rs | 4 +-- tooling/bundler/src/bundle/settings.rs | 3 +-- tooling/cli/Cargo.toml | 2 +- .../jest/fixtures/app/src-tauri/Cargo.toml | 2 +- tooling/cli/src/build.rs | 9 +++---- tooling/cli/src/dev.rs | 9 +++---- tooling/cli/src/helpers/flock.rs | 2 +- tooling/cli/src/helpers/updater_signature.rs | 4 +-- tooling/cli/src/icon.rs | 11 +++----- tooling/cli/src/info.rs | 14 +++++----- tooling/cli/src/interface/rust.rs | 4 +-- .../cli/src/interface/rust/cargo_config.rs | 2 +- tooling/cli/src/interface/rust/desktop.rs | 7 +++-- tooling/cli/src/interface/rust/manifest.rs | 4 +-- tooling/cli/src/lib.rs | 6 ++--- tooling/cli/src/mobile/init.rs | 9 +++---- tooling/cli/src/mobile/mod.rs | 2 +- .../app/src-tauri/Cargo.crate-manifest | 2 +- .../plugin/backend/.changes/config.json | 2 +- .../plugin/backend/.github/workflows/lint.yml | 2 +- .../plugin/backend/.github/workflows/test.yml | 2 +- .../plugin/backend/Cargo.crate-manifest | 2 +- .../vanilla/src-tauri/Cargo.crate-manifest | 2 +- .../plugin/with-api/.changes/config.json | 2 +- .../with-api/.github/workflows/clippy.yml | 2 +- .../with-api/.github/workflows/test.yml | 2 +- .../plugin/with-api/Cargo.crate-manifest | 2 +- .../svelte-app/src-tauri/Cargo.crate-manifest | 2 +- 68 files changed, 150 insertions(+), 148 deletions(-) create mode 100644 .changes/gtk16.md create mode 100644 .changes/msrv-1.64.md diff --git a/.changes/config.json b/.changes/config.json index 5df56a75d06..fccd29e9f32 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -7,7 +7,7 @@ "getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js cargo ${ pkgFile.pkg.package.name } ${ pkgFile.pkg.package.version }", "prepublish": [ "sudo apt-get update", - "sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev", + "sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev", "cargo install cargo-audit --features=fix", { "command": "cargo generate-lockfile", diff --git a/.changes/gtk16.md b/.changes/gtk16.md new file mode 100644 index 00000000000..035f8c1d289 --- /dev/null +++ b/.changes/gtk16.md @@ -0,0 +1,8 @@ +--- +"tauri-runtime": minor +"tauri-runtime-wry": minor +"tauri": minor +--- + +Update gtk to 0.16. + diff --git a/.changes/msrv-1.64.md b/.changes/msrv-1.64.md new file mode 100644 index 00000000000..b61ad529709 --- /dev/null +++ b/.changes/msrv-1.64.md @@ -0,0 +1,13 @@ +--- +"cli.rs": minor +"tauri-bundler": minor +"tauri": minor +"tauri-build": minor +"tauri-codegen": minor +"tauri-macros": minor +"tauri-utils": minor +"tauri-runtime": minor +"tauri-runtime-wry": minor +--- + +Bump the MSRV to 1.64. diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0435c8cf7b0..63d7bcd3ae6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,7 +6,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} # Derived from Tauri contribution and setup guides: # See: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#development-guide # See: https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux -ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.0-dev wget" +ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.1-dev wget" RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y --no-install-recommends $TAURI_BUILD_DEPS diff --git a/.docker/cross/aarch64.Dockerfile b/.docker/cross/aarch64.Dockerfile index 6dfb5bdaa71..498d055b75f 100644 --- a/.docker/cross/aarch64.Dockerfile +++ b/.docker/cross/aarch64.Dockerfile @@ -41,4 +41,4 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ RUN dpkg --add-architecture arm64 RUN apt-get update -RUN apt-get install --assume-yes --no-install-recommends libssl-dev:arm64 libdbus-1-dev:arm64 libsoup2.4-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 webkit2gtk-4.0-dev:arm64 libappindicator3-1:arm64 librsvg2-dev:arm64 patchelf:arm64 +RUN apt-get install --assume-yes --no-install-recommends libssl-dev:arm64 libdbus-1-dev:arm64 libsoup2.4-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 webkit2gtk-4.1-dev:arm64 libappindicator3-1:arm64 librsvg2-dev:arm64 patchelf:arm64 diff --git a/.github/workflows/artifacts-updater.yml b/.github/workflows/artifacts-updater.yml index fb1d316c3cb..2d654905c17 100644 --- a/.github/workflows/artifacts-updater.yml +++ b/.github/workflows/artifacts-updater.yml @@ -40,7 +40,7 @@ jobs: if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index c8315cf6a2b..8a489e659c7 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -47,7 +47,7 @@ jobs: run: | python -m pip install --upgrade pip sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev xvfb + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev xvfb wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb sudo dpkg -i hyperfine_1.11.0_amd64.deb pip install memory_profiler diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 05449342731..415318023e7 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -30,7 +30,7 @@ jobs: if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2 + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev libfuse2 - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dcf2e217980..bb01a2919cd 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -111,7 +111,7 @@ jobs: - name: install dependencies run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - name: Test run: | diff --git a/.github/workflows/lint-fmt-core.yml b/.github/workflows/lint-fmt-core.yml index 04fe41f4295..e7ccbc46663 100644 --- a/.github/workflows/lint-fmt-core.yml +++ b/.github/workflows/lint-fmt-core.yml @@ -62,7 +62,7 @@ jobs: - name: install dependencies run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/publish-cli-js.yml b/.github/workflows/publish-cli-js.yml index e7f2ed6ffd0..234c68f2689 100644 --- a/.github/workflows/publish-cli-js.yml +++ b/.github/workflows/publish-cli-js.yml @@ -257,7 +257,7 @@ jobs: - name: install system dependencies run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - name: Test bindings run: yarn test test-linux-x64-musl-binding: @@ -351,7 +351,7 @@ jobs: set -e export PATH=/usr/local/cargo/bin/:/usr/local/fnm:$PATH apt-get update - DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip webkit2gtk-4.0 libayatana-appindicator3-dev + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip webkit2gtk-4.1 libayatana-appindicator3-dev bash curl https://sh.rustup.rs -sSf | bash -s -- -y curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "/usr/local/fnm" --skip-shell diff --git a/.github/workflows/test-cli-js.yml b/.github/workflows/test-cli-js.yml index c178140c2c0..2060fb66fda 100644 --- a/.github/workflows/test-cli-js.yml +++ b/.github/workflows/test-cli-js.yml @@ -51,7 +51,7 @@ jobs: if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 258bd18b717..abbc4d916af 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -34,35 +34,35 @@ jobs: - { target: x86_64-pc-windows-msvc, os: windows-latest, - toolchain: '1.61.0', + toolchain: '1.64.0', cross: false, command: 'test' } - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, - toolchain: '1.59.0', + toolchain: '1.64.0', cross: false, command: 'test' } - { target: x86_64-apple-darwin, os: macos-latest, - toolchain: '1.59.0', + toolchain: '1.64.0', cross: false, command: 'test' } - { target: aarch64-apple-ios, os: macos-latest, - toolchain: '1.59.0', + toolchain: '1.64.0', cross: false, command: 'build' } - { target: aarch64-linux-android, os: ubuntu-latest, - toolchain: '1.59.0', + toolchain: '1.64.0', cross: true, command: 'build' } @@ -95,7 +95,7 @@ jobs: if: contains(matrix.platform.target, 'unknown-linux') run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/test-mobile.yml b/.github/workflows/test-mobile.yml index 6ebdf91eb30..73d83e9ddb2 100644 --- a/.github/workflows/test-mobile.yml +++ b/.github/workflows/test-mobile.yml @@ -33,7 +33,7 @@ jobs: if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 - name: setup node uses: actions/setup-node@v3 diff --git a/.github/workflows/udeps.yml b/.github/workflows/udeps.yml index dea90577245..41c294fbc8a 100644 --- a/.github/workflows/udeps.yml +++ b/.github/workflows/udeps.yml @@ -157,7 +157,7 @@ jobs: - name: Install required packages run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev + sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev - uses: actions-rs/cargo@v1 with: diff --git a/README.md b/README.md index 4feac90fd06..8a8f56f8602 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ For **developing** Tauri apps refer to the [Getting Started guide on tauri.app]( For **running** Tauri apps we support the below configurations (these are automatically added as dependencies for .deb and are bundled for AppImage so that your users don't need to manually install them): - Debian (Ubuntu 18.04 and above or equivalent) with the following packages installed: - - `libwebkit2gtk-4.0-37`, `libgtk-3-0`, `libayatana-appindicator3-1`1 + - `libwebkit2gtk-4.1-0`, `libgtk-3-0`, `libayatana-appindicator3-1`1 - Arch with the following packages installed: - `webkit2gtk`, `gtk3`, `libayatana-appindicator`1 - Fedora (latest 2 versions) with the following packages installed: diff --git a/core/tauri-build/Cargo.toml b/core/tauri-build/Cargo.toml index 1840ac2654a..1f0b3617ffd 100644 --- a/core/tauri-build/Cargo.toml +++ b/core/tauri-build/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build" description = "build time code to pair with https://crates.io/crates/tauri" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" diff --git a/core/tauri-codegen/Cargo.toml b/core/tauri-codegen/Cargo.toml index 6c434d130a0..36cc7b747eb 100644 --- a/core/tauri-codegen/Cargo.toml +++ b/core/tauri-codegen/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen" description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" diff --git a/core/tauri-macros/Cargo.toml b/core/tauri-macros/Cargo.toml index e79b037ef07..575d0f8bdf1 100644 --- a/core/tauri-macros/Cargo.toml +++ b/core/tauri-macros/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Macros for the tauri crate." edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index e9493d88222..c195ccf4f84 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -8,12 +8,12 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Wry bindings to the Tauri runtime" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" [dependencies] -wry = { git = "https://github.com/tauri-apps/wry", branch = "dev", default-features = false, features = [ "file-drop", "protocol" ] } +wry = { version = "0.25.0", default-features = false, features = [ "file-drop", "protocol" ] } tauri-runtime = { version = "0.13.0-alpha.0", path = "../tauri-runtime" } tauri-utils = { version = "2.0.0-alpha.0", path = "../tauri-utils" } uuid = { version = "1", features = [ "v4" ] } @@ -28,8 +28,8 @@ webview2-com = "0.19.1" features = [ "Win32_Foundation" ] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -gtk = { version = "0.15", features = [ "v3_20" ] } -webkit2gtk = { version = "0.18.2", features = [ "v2_22" ] } +gtk = { version = "0.16", features = [ "v3_24" ] } +webkit2gtk = { version = "0.19.1", features = [ "v2_38" ] } percent-encoding = "2.1" [target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies] diff --git a/core/tauri-runtime/Cargo.toml b/core/tauri-runtime/Cargo.toml index 9e670d96477..75d46e94a54 100644 --- a/core/tauri-runtime/Cargo.toml +++ b/core/tauri-runtime/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Runtime for Tauri applications" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" @@ -41,7 +41,7 @@ webview2-com = "0.19.1" features = [ "Win32_Foundation" ] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -gtk = { version = "0.15", features = [ "v3_20" ] } +gtk = { version = "0.16", features = [ "v3_24" ] } [features] devtools = [ ] diff --git a/core/tauri-utils/Cargo.toml b/core/tauri-utils/Cargo.toml index 785b415defc..84ea058a114 100644 --- a/core/tauri-utils/Cargo.toml +++ b/core/tauri-utils/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://tauri.app" repository = "https://github.com/tauri-apps/tauri" description = "Utilities for Tauri" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index f008d8f5ab8..d325b224378 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -3,7 +3,7 @@ authors = [ "Tauri Programme within The Commons Conservancy" ] categories = [ "gui", "web-programming" ] description = "Make tiny, secure apps for all desktop platforms with Tauri" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "/test", "/.scripts", "CHANGELOG.md", "/target" ] homepage = "https://tauri.app" license = "Apache-2.0 OR MIT" @@ -87,13 +87,13 @@ ico = { version = "0.2.0", optional = true } encoding_rs = "0.8.31" [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -rfd = { version = "0.10", optional = true } +rfd = { git = "https://github.com/PolyMeilex/rfd", version = "0.10", optional = true } notify-rust = { version = "4.5", default-features = false, features = [ "d" ], optional = true } [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -gtk = { version = "0.15", features = [ "v3_20" ] } -glib = "0.15" -webkit2gtk = { version = "0.18.2", features = [ "v2_22" ] } +gtk = { version = "0.16", features = [ "v3_24" ] } +glib = "0.16" +webkit2gtk = { version = "0.19.1", features = [ "v2_38" ] } [target."cfg(target_os = \"macos\")".dependencies] embed_plist = "1.2" diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index 599453b8dda..31a0ad7fbc9 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "api" version = "0.1.0" description = "An example Tauri Application showcasing the api" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" license = "Apache-2.0 OR MIT" [lib] diff --git a/examples/commands/main.rs b/examples/commands/main.rs index 81409d4011a..ce20be00686 100644 --- a/examples/commands/main.rs +++ b/examples/commands/main.rs @@ -85,7 +85,7 @@ fn force_async(the_argument: String) -> String { #[command(async)] fn force_async_with_result(the_argument: &str) -> Result<&str, MyError> { (!the_argument.is_empty()) - .then(|| the_argument) + .then_some(the_argument) .ok_or(MyError::FooError) } @@ -121,7 +121,7 @@ fn force_async_snake(the_argument: String) -> String { #[command(rename_all = "snake_case", async)] fn force_async_with_result_snake(the_argument: &str) -> Result<&str, MyError> { (!the_argument.is_empty()) - .then(|| the_argument) + .then_some(the_argument) .ok_or(MyError::FooError) } @@ -131,7 +131,7 @@ fn force_async_with_result_snake(the_argument: &str) -> Result<&str, MyError> { fn simple_command_with_result(the_argument: String) -> Result { println!("{the_argument}"); (!the_argument.is_empty()) - .then(|| the_argument) + .then_some(the_argument) .ok_or(MyError::FooError) } @@ -150,7 +150,7 @@ fn stateful_command_with_result( fn simple_command_with_result_snake(the_argument: String) -> Result { println!("{the_argument}"); (!the_argument.is_empty()) - .then(|| the_argument) + .then_some(the_argument) .ok_or(MyError::FooError) } diff --git a/examples/resources/src-tauri/Cargo.toml b/examples/resources/src-tauri/Cargo.toml index 50daca46e63..f30c127c515 100644 --- a/examples/resources/src-tauri/Cargo.toml +++ b/examples/resources/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "resources" version = "0.1.0" description = "A Tauri application that uses Node.js with app resources" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [build-dependencies] tauri-build = { path = "../../../core/tauri-build", features = [ "codegen" ] } diff --git a/examples/sidecar/src-tauri/Cargo.toml b/examples/sidecar/src-tauri/Cargo.toml index ab770ce2137..c6b24de7a7f 100644 --- a/examples/sidecar/src-tauri/Cargo.toml +++ b/examples/sidecar/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "sidecar" version = "0.1.0" description = "A Tauri application with a sidecar binary" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [build-dependencies] tauri-build = { path = "../../../core/tauri-build", features = ["codegen"] } diff --git a/examples/tauri-dynamic-lib/src-app1/Cargo.toml b/examples/tauri-dynamic-lib/src-app1/Cargo.toml index c2341022f33..756c0083b82 100644 --- a/examples/tauri-dynamic-lib/src-app1/Cargo.toml +++ b/examples/tauri-dynamic-lib/src-app1/Cargo.toml @@ -3,7 +3,7 @@ name = "app1" version = "0.1.0" description = "A simple app that makes a dll call" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [workspace] diff --git a/examples/tauri-dynamic-lib/src-tauri/Cargo.toml b/examples/tauri-dynamic-lib/src-tauri/Cargo.toml index 66921386d18..a9217c63928 100644 --- a/examples/tauri-dynamic-lib/src-tauri/Cargo.toml +++ b/examples/tauri-dynamic-lib/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "tauri_app" version = "0.1.0" description = "A very simple Dll Library that runs tauri and launches a webview window" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [workspace] diff --git a/examples/updater/src-tauri/Cargo.toml b/examples/updater/src-tauri/Cargo.toml index 50b414f8161..cc9d0f37311 100644 --- a/examples/updater/src-tauri/Cargo.toml +++ b/examples/updater/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "updater-example" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" license = "Apache-2.0 OR MIT" [build-dependencies] diff --git a/examples/web/core/tauri/Cargo.toml b/examples/web/core/tauri/Cargo.toml index a4e5ba1be6f..99c147a8781 100644 --- a/examples/web/core/tauri/Cargo.toml +++ b/examples/web/core/tauri/Cargo.toml @@ -7,7 +7,7 @@ license = "" repository = "" default-run = "app" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [build-dependencies] tauri-build = { path = "../../../../core/tauri-build", features = [] } diff --git a/tooling/bench/Cargo.toml b/tooling/bench/Cargo.toml index 888545cffb1..0c977b566ce 100644 --- a/tooling/bench/Cargo.toml +++ b/tooling/bench/Cargo.toml @@ -5,7 +5,7 @@ name = "tauri_bench" version = "0.1.0" authors = [ "Tauri Programme within The Commons Conservancy" ] edition = "2021" -rust-version = "1.59" +rust-version = "1.64" license = "Apache-2.0 OR MIT" description = "Cross-platform WebView rendering library" repository = "https://github.com/tauri-apps/wry" diff --git a/tooling/bench/tests/cpu_intensive/src-tauri/Cargo.toml b/tooling/bench/tests/cpu_intensive/src-tauri/Cargo.toml index 5120e5f3060..717d2869037 100644 --- a/tooling/bench/tests/cpu_intensive/src-tauri/Cargo.toml +++ b/tooling/bench/tests/cpu_intensive/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "bench_cpu_intensive" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [build-dependencies] tauri-build = { path = "../../../../../core/tauri-build", features = [ "codegen" ] } diff --git a/tooling/bench/tests/files_transfer/src-tauri/Cargo.toml b/tooling/bench/tests/files_transfer/src-tauri/Cargo.toml index f643bd0fdb6..a925da8a5f9 100644 --- a/tooling/bench/tests/files_transfer/src-tauri/Cargo.toml +++ b/tooling/bench/tests/files_transfer/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "bench_files_transfer" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [build-dependencies] tauri-build = { path = "../../../../../core/tauri-build", features = [ "codegen" ] } diff --git a/tooling/bench/tests/helloworld/src-tauri/Cargo.toml b/tooling/bench/tests/helloworld/src-tauri/Cargo.toml index 0b3040181f5..1ff22a0098c 100644 --- a/tooling/bench/tests/helloworld/src-tauri/Cargo.toml +++ b/tooling/bench/tests/helloworld/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "bench_helloworld" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [build-dependencies] tauri-build = { path = "../../../../../core/tauri-build", features = [ "codegen" ] } diff --git a/tooling/bundler/Cargo.toml b/tooling/bundler/Cargo.toml index 5b12fc16d69..6de0c5dc337 100644 --- a/tooling/bundler/Cargo.toml +++ b/tooling/bundler/Cargo.toml @@ -13,7 +13,7 @@ keywords = [ "bundle", "cargo", "tauri" ] repository = "https://github.com/tauri-apps/tauri" description = "Wrap rust executables in OS-specific app bundles for Tauri" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = [ "CHANGELOG.md", "/target", "rustfmt.toml" ] [dependencies] diff --git a/tooling/bundler/src/bundle/category.rs b/tooling/bundler/src/bundle/category.rs index 2aff14c25c8..63861e13a85 100644 --- a/tooling/bundler/src/bundle/category.rs +++ b/tooling/bundler/src/bundle/category.rs @@ -254,8 +254,7 @@ impl<'d> serde::de::Visitor<'d> for AppCategoryVisitor { match self.did_you_mean { Some(string) => write!( formatter, - "a valid app category string (did you mean \"{}\"?)", - string + "a valid app category string (did you mean \"{string}\"?)" ), None => write!(formatter, "a valid app category string"), } diff --git a/tooling/bundler/src/bundle/common.rs b/tooling/bundler/src/bundle/common.rs index 19e91b15e6b..fe3c61dc625 100644 --- a/tooling/bundler/src/bundle/common.rs +++ b/tooling/bundler/src/bundle/common.rs @@ -72,14 +72,12 @@ pub fn copy_file(from: impl AsRef, to: impl AsRef) -> crate::Result< let to = to.as_ref(); if !from.exists() { return Err(crate::Error::GenericError(format!( - "{:?} does not exist", - from + "{from:?} does not exist" ))); } if !from.is_file() { return Err(crate::Error::GenericError(format!( - "{:?} is not a file", - from + "{from:?} is not a file" ))); } let dest_dir = to.parent().expect("No data in parent"); @@ -96,20 +94,17 @@ pub fn copy_file(from: impl AsRef, to: impl AsRef) -> crate::Result< pub fn copy_dir(from: &Path, to: &Path) -> crate::Result<()> { if !from.exists() { return Err(crate::Error::GenericError(format!( - "{:?} does not exist", - from + "{from:?} does not exist" ))); } if !from.is_dir() { return Err(crate::Error::GenericError(format!( - "{:?} is not a Directory", - from + "{from:?} is not a Directory" ))); } if to.exists() { return Err(crate::Error::GenericError(format!( - "{:?} already exists", - from + "{from:?} already exists" ))); } let parent = to.parent().expect("No data in parent"); @@ -142,7 +137,7 @@ pub trait CommandExt { impl CommandExt for Command { fn output_ok(&mut self) -> crate::Result { let program = self.get_program().to_string_lossy().into_owned(); - debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{} {}", acc, arg))); + debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}"))); self.stdout(Stdio::piped()); self.stderr(Stdio::piped()); @@ -196,8 +191,7 @@ impl CommandExt for Command { Ok(output) } else { Err(crate::Error::GenericError(format!( - "failed to run {}", - program + "failed to run {program}" ))) } } diff --git a/tooling/bundler/src/bundle/linux/debian.rs b/tooling/bundler/src/bundle/linux/debian.rs index 8c8b436849f..1c9d921dba8 100644 --- a/tooling/bundler/src/bundle/linux/debian.rs +++ b/tooling/bundler/src/bundle/linux/debian.rs @@ -65,13 +65,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result> { settings.version_string(), arch ); - let package_name = format!("{}.deb", package_base_name); + let package_name = format!("{package_base_name}.deb"); let base_dir = settings.project_out_directory().join("bundle/deb"); let package_dir = base_dir.join(&package_base_name); if package_dir.exists() { fs::remove_dir_all(&package_dir) - .with_context(|| format!("Failed to remove old {}", package_base_name))?; + .with_context(|| format!("Failed to remove old {package_base_name}"))?; } let package_path = base_dir.join(&package_name); @@ -118,7 +118,7 @@ pub fn generate_data( for bin in settings.binaries() { let bin_path = settings.binary_path(bin); common::copy_file(&bin_path, bin_dir.join(bin.name())) - .with_context(|| format!("Failed to copy binary from {:?}", bin_path))?; + .with_context(|| format!("Failed to copy binary from {bin_path:?}"))?; } copy_resource_files(settings, &data_dir).with_context(|| "Failed to copy resource files")?; @@ -137,7 +137,7 @@ pub fn generate_data( /// Generate the application desktop file and store it under the `data_dir`. fn generate_desktop_file(settings: &Settings, data_dir: &Path) -> crate::Result<()> { let bin_name = settings.main_binary_name(); - let desktop_file_name = format!("{}.desktop", bin_name); + let desktop_file_name = format!("{bin_name}.desktop"); let desktop_file_path = data_dir .join("usr/share/applications") .join(desktop_file_name); @@ -153,8 +153,8 @@ fn generate_desktop_file(settings: &Settings, data_dir: &Path) -> crate::Result< if !settings.short_description().is_empty() { writeln!(file, "Comment={}", settings.short_description())?; } - writeln!(file, "Exec={}", bin_name)?; - writeln!(file, "Icon={}", bin_name)?; + writeln!(file, "Exec={bin_name}")?; + writeln!(file, "Icon={bin_name}")?; writeln!(file, "Name={}", settings.product_name())?; writeln!(file, "Terminal=false")?; writeln!(file, "Type=Application")?; @@ -174,11 +174,11 @@ fn generate_control_file( let mut file = common::create_file(&dest_path)?; writeln!(file, "Package: {}", AsKebabCase(settings.product_name()))?; writeln!(file, "Version: {}", settings.version_string())?; - writeln!(file, "Architecture: {}", arch)?; + writeln!(file, "Architecture: {arch}")?; // Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size writeln!(file, "Installed-Size: {}", total_dir_size(data_dir)? / 1024)?; let authors = settings.authors_comma_separated().unwrap_or_default(); - writeln!(file, "Maintainer: {}", authors)?; + writeln!(file, "Maintainer: {authors}")?; if !settings.homepage_url().is_empty() { writeln!(file, "Homepage: {}", settings.homepage_url())?; } @@ -194,13 +194,13 @@ fn generate_control_file( if long_description.is_empty() { long_description = "(none)"; } - writeln!(file, "Description: {}", short_description)?; + writeln!(file, "Description: {short_description}")?; for line in long_description.lines() { let line = line.trim(); if line.is_empty() { writeln!(file, " .")?; } else { - writeln!(file, " {}", line)?; + writeln!(file, " {line}")?; } } writeln!(file, "Priority: optional")?; @@ -223,14 +223,14 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> { let mut hash = md5::Context::new(); io::copy(&mut file, &mut hash)?; for byte in hash.compute().iter() { - write!(md5sums_file, "{:02x}", byte)?; + write!(md5sums_file, "{byte:02x}")?; } let rel_path = path.strip_prefix(data_dir)?; let path_str = rel_path.to_str().ok_or_else(|| { - let msg = format!("Non-UTF-8 path: {:?}", rel_path); + let msg = format!("Non-UTF-8 path: {rel_path:?}"); io::Error::new(io::ErrorKind::InvalidData, msg) })?; - writeln!(md5sums_file, " {}", path_str)?; + writeln!(md5sums_file, " {path_str}")?; } Ok(()) } diff --git a/tooling/bundler/src/bundle/path_utils.rs b/tooling/bundler/src/bundle/path_utils.rs index f3c55046415..45b0c3c8cf7 100644 --- a/tooling/bundler/src/bundle/path_utils.rs +++ b/tooling/bundler/src/bundle/path_utils.rs @@ -104,7 +104,7 @@ where let from = from.as_ref(); if !from.exists() { if let Some(msg) = from.to_str() { - let msg = format!("Path \"{}\" does not exist or you don't have access", msg); + let msg = format!("Path \"{msg}\" does not exist or you don't have access"); return Err(crate::Error::PathUtilError(msg)); } return Err(crate::Error::PathUtilError( @@ -114,7 +114,7 @@ where if !from.is_file() { if let Some(msg) = from.to_str() { - let msg = format!("Path \"{}\" is not a file!", msg); + let msg = format!("Path \"{msg}\" is not a file!"); return Err(crate::Error::PathUtilError(msg)); } return Err(crate::Error::PathUtilError( @@ -127,7 +127,7 @@ where } if let Some(msg) = to.as_ref().to_str() { - let msg = format!("Path \"{}\" is exist", msg); + let msg = format!("Path \"{msg}\" is exist"); return Err(crate::Error::PathUtilError(msg)); } } @@ -145,7 +145,7 @@ where let from = from.as_ref(); if !from.exists() { if let Some(msg) = from.to_str() { - let msg = format!("Path \"{}\" does not exist or you don't have access!", msg); + let msg = format!("Path \"{msg}\" does not exist or you don't have access!"); return Err(crate::Error::PathUtilError(msg)); } return Err(crate::Error::PathUtilError( @@ -154,7 +154,7 @@ where } if !from.is_dir() { if let Some(msg) = from.to_str() { - let msg = format!("Path \"{}\" is not a directory!", msg); + let msg = format!("Path \"{msg}\" is not a directory!"); return Err(crate::Error::PathUtilError(msg)); } return Err(crate::Error::PathUtilError( diff --git a/tooling/bundler/src/bundle/platform.rs b/tooling/bundler/src/bundle/platform.rs index d06300a3c78..64792c2003c 100644 --- a/tooling/bundler/src/bundle/platform.rs +++ b/tooling/bundler/src/bundle/platform.rs @@ -95,10 +95,10 @@ pub fn target_triple() -> Result { ))); }; - format!("{}-{}", os, env) + format!("{os}-{env}") }; - Ok(format!("{}-{}", arch, os)) + Ok(format!("{arch}-{os}")) } #[cfg(test)] diff --git a/tooling/bundler/src/bundle/settings.rs b/tooling/bundler/src/bundle/settings.rs index 3aff75adb36..6f448530a03 100644 --- a/tooling/bundler/src/bundle/settings.rs +++ b/tooling/bundler/src/bundle/settings.rs @@ -574,8 +574,7 @@ impl Settings { "windows" => vec![PackageType::WindowsMsi], os => { return Err(crate::Error::GenericError(format!( - "Native {} bundles not yet supported.", - os + "Native {os} bundles not yet supported." ))) } }; diff --git a/tooling/cli/Cargo.toml b/tooling/cli/Cargo.toml index be08a2ff162..4c75ee57bf4 100644 --- a/tooling/cli/Cargo.toml +++ b/tooling/cli/Cargo.toml @@ -6,7 +6,7 @@ name = "tauri-cli" version = "2.0.0-alpha.1" authors = [ "Tauri Programme within The Commons Conservancy" ] edition = "2021" -rust-version = "1.59" +rust-version = "1.64" categories = [ "gui", "web-programming" ] license = "Apache-2.0 OR MIT" homepage = "https://tauri.app" diff --git a/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml b/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml index 9fec9d9ede2..c0281ee26ba 100644 --- a/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml +++ b/tooling/cli/node/test/jest/fixtures/app/src-tauri/Cargo.toml @@ -8,7 +8,7 @@ authors = [ "Tauri Programme within The Commons Conservancy" ] license = "" repository = "" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [package.metadata.bundle] identifier = "com.tauri.dev" diff --git a/tooling/cli/src/build.rs b/tooling/cli/src/build.rs index cc85f24e60b..0f052a448a8 100644 --- a/tooling/cli/src/build.rs +++ b/tooling/cli/src/build.rs @@ -89,8 +89,7 @@ pub fn command(mut options: Options) -> Result<()> { } None => { return Err(anyhow::anyhow!(format!( - "Unsupported bundle format: {}", - name + "Unsupported bundle format: {name}" ))); } } @@ -361,7 +360,7 @@ fn run_hook(name: &str, hook: HookCommand, interface: &AppInterface, debug: bool .current_dir(cwd) .envs(env) .piped() - .with_context(|| format!("failed to run `{}` with `sh -c`", script))?; + .with_context(|| format!("failed to run `{script}` with `sh -c`"))?; if !status.success() { bail!( @@ -396,9 +395,9 @@ mod pkgconfig_utils { pub fn get_appindicator_library_path() -> PathBuf { match get_library_path("ayatana-appindicator3-0.1") { - Some(p) => format!("{}/libayatana-appindicator3.so.1", p).into(), + Some(p) => format!("{p}/libayatana-appindicator3.so.1").into(), None => match get_library_path("appindicator3-0.1") { - Some(p) => format!("{}/libappindicator3.so.1", p).into(), + Some(p) => format!("{p}/libappindicator3.so.1").into(), None => panic!("Can't detect any appindicator library"), }, } diff --git a/tooling/cli/src/dev.rs b/tooling/cli/src/dev.rs index df10d98aab7..ec10a8d5284 100644 --- a/tooling/cli/src/dev.rs +++ b/tooling/cli/src/dev.rs @@ -231,7 +231,7 @@ pub fn setup(options: &mut Options, mobile: bool) -> Result { command.stderr(os_pipe::dup_stderr()?); let child = SharedChild::spawn(&mut command) - .unwrap_or_else(|_| panic!("failed to run `{}`", before_dev)); + .unwrap_or_else(|_| panic!("failed to run `{before_dev}`")); let child = Arc::new(child); let child_ = child.clone(); @@ -294,7 +294,7 @@ pub fn setup(options: &mut Options, mobile: bool) -> Result { let server_address = SocketAddr::new(ip, port); let path = path.canonicalize()?; start_dev_server(server_address, path); - let server_url = format!("http://{}", server_address); + let server_url = format!("http://{server_address}"); dev_path = AppUrl::Url(WindowUrl::External(server_url.parse().unwrap())); // TODO: in v2, use an env var to pass the url to the app context @@ -306,10 +306,7 @@ pub fn setup(options: &mut Options, mobile: bool) -> Result { c.build.dev_path = dev_path.clone(); options.config = Some(serde_json::to_string(&c).unwrap()); } else { - options.config = Some(format!( - r#"{{ "build": {{ "devPath": "{}" }} }}"#, - server_url - )) + options.config = Some(format!(r#"{{ "build": {{ "devPath": "{server_url}" }} }}"#)) } } diff --git a/tooling/cli/src/helpers/flock.rs b/tooling/cli/src/helpers/flock.rs index b5ff6c8a1f3..c2fcc603a4d 100644 --- a/tooling/cli/src/helpers/flock.rs +++ b/tooling/cli/src/helpers/flock.rs @@ -209,7 +209,7 @@ fn acquire( } } } - let msg = format!("waiting for file lock on {}", msg); + let msg = format!("waiting for file lock on {msg}"); log::info!(action = "Blocking"; "{}", &msg); lock_block().with_context(|| format!("failed to lock file: {}", path.display()))?; diff --git a/tooling/cli/src/helpers/updater_signature.rs b/tooling/cli/src/helpers/updater_signature.rs index d022053dab8..6b86092145c 100644 --- a/tooling/cli/src/helpers/updater_signature.rs +++ b/tooling/cli/src/helpers/updater_signature.rs @@ -81,11 +81,11 @@ where } let mut sk_writer = create_file(sk_path)?; - write!(sk_writer, "{:}", key)?; + write!(sk_writer, "{key:}")?; sk_writer.flush()?; let mut pk_writer = create_file(pk_path)?; - write!(pk_writer, "{:}", pubkey)?; + write!(pk_writer, "{pubkey:}")?; pk_writer.flush()?; Ok((fs::canonicalize(sk_path)?, fs::canonicalize(pk_path)?)) diff --git a/tooling/cli/src/icon.rs b/tooling/cli/src/icon.rs index faa351dcc3f..cc71e48bc19 100644 --- a/tooling/cli/src/icon.rs +++ b/tooling/cli/src/icon.rs @@ -83,7 +83,7 @@ fn appx(source: &DynamicImage, out_dir: &Path) -> Result<()> { resize_and_save_png(source, 50, &out_dir.join("StoreLogo.png"))?; for size in [30, 44, 71, 89, 107, 142, 150, 284, 310] { - let file_name = format!("Square{}x{}Logo.png", size, size); + let file_name = format!("Square{size}x{size}Logo.png"); log::info!(action = "Appx"; "Creating {}", file_name); resize_and_save_png(source, size, &out_dir.join(&file_name))?; @@ -115,7 +115,7 @@ fn icns(source: &DynamicImage, out_dir: &Path) -> Result<()> { &image, IconType::from_ostype(entry.ostype.parse().unwrap()).unwrap(), ) - .with_context(|| format!("Can't add {} to Icns Family", name))?; + .with_context(|| format!("Can't add {name} to Icns Family"))?; } let mut out_file = BufWriter::new(File::create(out_dir.join("icon.icns"))?); @@ -169,7 +169,7 @@ fn png(source: &DynamicImage, out_dir: &Path) -> Result<()> { let file_name = match size { 256 => "128x128@2x.png".to_string(), 512 => "icon.png".to_string(), - _ => format!("{}x{}.png", size, size), + _ => format!("{size}x{size}.png"), }; entries.push(PngEntry { @@ -307,10 +307,7 @@ fn png(source: &DynamicImage, out_dir: &Path) -> Result<()> { }); } for multiplier in target.multipliers { - let name = format!( - "AppIcon-{size_str}@{multiplier}x.png", - multiplier = multiplier - ); + let name = format!("AppIcon-{size_str}@{multiplier}x.png"); entries.push(PngEntry { out_path: out_dir.join(&name), name, diff --git a/tooling/cli/src/info.rs b/tooling/cli/src/info.rs index 8b75901528a..931b77fe0e6 100644 --- a/tooling/cli/src/info.rs +++ b/tooling/cli/src/info.rs @@ -128,7 +128,7 @@ pub(crate) fn cli_upstream_version() -> Result { } fn crate_latest_version(name: &str) -> Option { - let url = format!("https://docs.rs/crate/{}/", name); + let url = format!("https://docs.rs/crate/{name}/"); match ureq::get(&url).call() { Ok(response) => match (response.status(), response.header("location")) { (302, Some(location)) => Some(location.replace(&url, "")), @@ -431,7 +431,7 @@ fn crate_version( crate_lock_package.version.clone() }; ( - format!("{} (no manifest)", version_string), + format!("{version_string} (no manifest)"), vec![crate_lock_package.version.clone()], ) } @@ -457,14 +457,14 @@ fn crate_version( Ok(manifest) => manifest.package.version, Err(_) => "unknown version".to_string(), }; - format!("path:{:?} [{}]", p, v) + format!("path:{p:?} [{v}]") } else if let Some(g) = p.git { is_git = true; - let mut v = format!("git:{}", g); + let mut v = format!("git:{g}"); if let Some(branch) = p.branch { - let _ = write!(v, "&branch={}", branch); + let _ = write!(v, "&branch={branch}"); } else if let Some(rev) = p.rev { - let _ = write!(v, "#{}", rev); + let _ = write!(v, "#{rev}"); } v } else { @@ -505,7 +505,7 @@ fn crate_version( (Some(version), Some(target_version)) => { let target_version = semver::Version::parse(&target_version).unwrap(); if version < target_version { - Some(format!(" (outdated, latest: {})", target_version)) + Some(format!(" (outdated, latest: {target_version})")) } else { None } diff --git a/tooling/cli/src/interface/rust.rs b/tooling/cli/src/interface/rust.rs index 2bbfd370cd5..1b6a1e53c6d 100644 --- a/tooling/cli/src/interface/rust.rs +++ b/tooling/cli/src/interface/rust.rs @@ -950,8 +950,8 @@ fn tauri_config_to_bundle_settings( } } - // provides `libwebkit2gtk-4.0.so.37` and all `4.0` versions have the -37 package name - depends.push("libwebkit2gtk-4.0-37".to_string()); + // provides `libwebkit2gtk-4.1.so.37` and all `4.0` versions have the -37 package name + depends.push("libwebkit2gtk-4.1-0".to_string()); depends.push("libgtk-3-0".to_string()); } diff --git a/tooling/cli/src/interface/rust/cargo_config.rs b/tooling/cli/src/interface/rust/cargo_config.rs index b55389bff84..8adca17dd1c 100644 --- a/tooling/cli/src/interface/rust/cargo_config.rs +++ b/tooling/cli/src/interface/rust/cargo_config.rs @@ -103,7 +103,7 @@ fn get_file_path( warn: bool, ) -> Result> { let possible = dir.join(filename_without_extension); - let possible_with_extension = dir.join(format!("{}.toml", filename_without_extension)); + let possible_with_extension = dir.join(format!("{filename_without_extension}.toml")); if possible.exists() { if warn && possible_with_extension.exists() { diff --git a/tooling/cli/src/interface/rust/desktop.rs b/tooling/cli/src/interface/rust/desktop.rs index 2ad00feb75c..92960a4fe4c 100644 --- a/tooling/cli/src/interface/rust/desktop.rs +++ b/tooling/cli/src/interface/rust/desktop.rs @@ -151,10 +151,10 @@ pub fn build( let triple_out_dir = app_settings .out_dir(Some(triple.into()), options.debug) - .with_context(|| format!("failed to get {} out dir", triple))?; + .with_context(|| format!("failed to get {triple} out dir"))?; build_production_app(options, available_targets, config_features.clone()) - .with_context(|| format!("failed to build {} binary", triple))?; + .with_context(|| format!("failed to build {triple} binary"))?; lipo_cmd.arg(triple_out_dir.join(bin_name)); } @@ -162,8 +162,7 @@ pub fn build( let lipo_status = lipo_cmd.output_ok()?.status; if !lipo_status.success() { return Err(anyhow::anyhow!(format!( - "Result of `lipo` command was unsuccessful: {}. (Is `lipo` installed?)", - lipo_status + "Result of `lipo` command was unsuccessful: {lipo_status}. (Is `lipo` installed?)" ))); } } else { diff --git a/tooling/cli/src/interface/rust/manifest.rs b/tooling/cli/src/interface/rust/manifest.rs index 35b2c4eb837..b47b8e437a7 100644 --- a/tooling/cli/src/interface/rust/manifest.rs +++ b/tooling/cli/src/interface/rust/manifest.rs @@ -54,7 +54,7 @@ impl Manifest { let mut all_enabled_features: Vec = self .tauri_features .iter() - .map(|f| format!("tauri/{}", f)) + .map(|f| format!("tauri/{f}")) .collect(); let manifest_features = self.features(); @@ -86,7 +86,7 @@ pub fn read_manifest(manifest_path: &Path) -> crate::Result { let mut manifest_str = String::new(); let mut manifest_file = File::open(manifest_path) - .with_context(|| format!("failed to open `{:?}` file", manifest_path))?; + .with_context(|| format!("failed to open `{manifest_path:?}` file"))?; manifest_file.read_to_string(&mut manifest_str)?; let manifest: Document = manifest_str diff --git a/tooling/cli/src/lib.rs b/tooling/cli/src/lib.rs index 1d8af2edeed..24fa3e902f2 100644 --- a/tooling/cli/src/lib.rs +++ b/tooling/cli/src/lib.rs @@ -184,7 +184,7 @@ where .try_init(); if let Err(err) = init_res { - eprintln!("Failed to attach logger: {}", err); + eprintln!("Failed to attach logger: {err}"); } match cli.command { @@ -235,14 +235,14 @@ impl CommandExt for Command { self.stdout(os_pipe::dup_stdout()?); self.stderr(os_pipe::dup_stderr()?); let program = self.get_program().to_string_lossy().into_owned(); - debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{} {}", acc, arg))); + debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}"))); self.status().map_err(Into::into) } fn output_ok(&mut self) -> crate::Result { let program = self.get_program().to_string_lossy().into_owned(); - debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{} {}", acc, arg))); + debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}"))); self.stdout(Stdio::piped()); self.stderr(Stdio::piped()); diff --git a/tooling/cli/src/mobile/init.rs b/tooling/cli/src/mobile/init.rs index 4a07876c36d..dd9b97f7bb7 100644 --- a/tooling/cli/src/mobile/init.rs +++ b/tooling/cli/src/mobile/init.rs @@ -193,10 +193,7 @@ fn get_str<'a>(helper: &'a Helper) -> &'a str { .unwrap_or("") } -fn get_str_array<'a>( - helper: &'a Helper, - formatter: impl Fn(&str) -> String, -) -> Option> { +fn get_str_array(helper: &Helper, formatter: impl Fn(&str) -> String) -> Option> { helper.param(0).and_then(|v| { v.value().as_array().and_then(|arr| { arr @@ -249,7 +246,7 @@ fn quote_and_join( ) -> HelperResult { out .write( - &get_str_array(helper, |s| format!("{:?}", s)) + &get_str_array(helper, |s| format!("{s:?}")) .ok_or_else(|| RenderError::new("`quote-and-join` helper wasn't given an array"))? .join(", "), ) @@ -265,7 +262,7 @@ fn quote_and_join_colon_prefix( ) -> HelperResult { out .write( - &get_str_array(helper, |s| format!("{:?}", format!(":{}", s))) + &get_str_array(helper, |s| format!("{:?}", format!(":{s}"))) .ok_or_else(|| { RenderError::new("`quote-and-join-colon-prefix` helper wasn't given an array") })? diff --git a/tooling/cli/src/mobile/mod.rs b/tooling/cli/src/mobile/mod.rs index bac4f89e206..e92f0fa4f90 100644 --- a/tooling/cli/src/mobile/mod.rs +++ b/tooling/cli/src/mobile/mod.rs @@ -160,7 +160,7 @@ fn setup_dev_config(config_extension: &mut Option) -> crate::Result<()> c.build.dev_path = dev_path.clone(); config_extension.replace(serde_json::to_string(&c).unwrap()); } else { - config_extension.replace(format!(r#"{{ "build": {{ "devPath": "{}" }} }}"#, url)); + config_extension.replace(format!(r#"{{ "build": {{ "devPath": "{url}" }} }}"#)); } reload_config(config_extension.as_deref())?; } diff --git a/tooling/cli/templates/app/src-tauri/Cargo.crate-manifest b/tooling/cli/templates/app/src-tauri/Cargo.crate-manifest index bae491d80b1..0d69e61d371 100755 --- a/tooling/cli/templates/app/src-tauri/Cargo.crate-manifest +++ b/tooling/cli/templates/app/src-tauri/Cargo.crate-manifest @@ -6,7 +6,7 @@ authors = ["you"] license = "" repository = "" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tooling/cli/templates/plugin/backend/.changes/config.json b/tooling/cli/templates/plugin/backend/.changes/config.json index 680d32c8243..6ce1cfed51a 100755 --- a/tooling/cli/templates/plugin/backend/.changes/config.json +++ b/tooling/cli/templates/plugin/backend/.changes/config.json @@ -6,7 +6,7 @@ "getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -", "prepublish": [ "sudo apt-get update", - "sudo apt-get install -y webkit2gtk-4.0", + "sudo apt-get install -y webkit2gtk-4.1", "cargo install cargo-audit", { "command": "cargo generate-lockfile", diff --git a/tooling/cli/templates/plugin/backend/.github/workflows/lint.yml b/tooling/cli/templates/plugin/backend/.github/workflows/lint.yml index 037e7b3b55f..6269a79eaf1 100644 --- a/tooling/cli/templates/plugin/backend/.github/workflows/lint.yml +++ b/tooling/cli/templates/plugin/backend/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: - name: install webkit2gtk run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 + sudo apt-get install -y webkit2gtk-4.1 - name: Install clippy with stable toolchain uses: actions-rs/toolchain@v1 with: diff --git a/tooling/cli/templates/plugin/backend/.github/workflows/test.yml b/tooling/cli/templates/plugin/backend/.github/workflows/test.yml index 284e08cf925..30124773b82 100755 --- a/tooling/cli/templates/plugin/backend/.github/workflows/test.yml +++ b/tooling/cli/templates/plugin/backend/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 + sudo apt-get install -y webkit2gtk-4.1 - uses: Swatinem/rust-cache@v2 diff --git a/tooling/cli/templates/plugin/backend/Cargo.crate-manifest b/tooling/cli/templates/plugin/backend/Cargo.crate-manifest index 87d9731ab40..21bf73ed06e 100755 --- a/tooling/cli/templates/plugin/backend/Cargo.crate-manifest +++ b/tooling/cli/templates/plugin/backend/Cargo.crate-manifest @@ -4,7 +4,7 @@ version = "0.0.0" authors = [ "{{ author }}" ] description = "" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = ["/examples"] [dependencies] diff --git a/tooling/cli/templates/plugin/backend/examples/vanilla/src-tauri/Cargo.crate-manifest b/tooling/cli/templates/plugin/backend/examples/vanilla/src-tauri/Cargo.crate-manifest index 74a685bdfd7..dc239129cb7 100644 --- a/tooling/cli/templates/plugin/backend/examples/vanilla/src-tauri/Cargo.crate-manifest +++ b/tooling/cli/templates/plugin/backend/examples/vanilla/src-tauri/Cargo.crate-manifest @@ -5,7 +5,7 @@ description = "A Tauri App" authors = [ "{{ author }}" ] repository = "" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [dependencies] serde_json = "1.0" diff --git a/tooling/cli/templates/plugin/with-api/.changes/config.json b/tooling/cli/templates/plugin/with-api/.changes/config.json index 25df39379e3..b12ed482934 100755 --- a/tooling/cli/templates/plugin/with-api/.changes/config.json +++ b/tooling/cli/templates/plugin/with-api/.changes/config.json @@ -6,7 +6,7 @@ "getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -", "prepublish": [ "sudo apt-get update", - "sudo apt-get install -y webkit2gtk-4.0", + "sudo apt-get install -y webkit2gtk-4.1", "cargo install cargo-audit", { "command": "cargo generate-lockfile", diff --git a/tooling/cli/templates/plugin/with-api/.github/workflows/clippy.yml b/tooling/cli/templates/plugin/with-api/.github/workflows/clippy.yml index 037e7b3b55f..6269a79eaf1 100644 --- a/tooling/cli/templates/plugin/with-api/.github/workflows/clippy.yml +++ b/tooling/cli/templates/plugin/with-api/.github/workflows/clippy.yml @@ -21,7 +21,7 @@ jobs: - name: install webkit2gtk run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 + sudo apt-get install -y webkit2gtk-4.1 - name: Install clippy with stable toolchain uses: actions-rs/toolchain@v1 with: diff --git a/tooling/cli/templates/plugin/with-api/.github/workflows/test.yml b/tooling/cli/templates/plugin/with-api/.github/workflows/test.yml index 81823087373..49e7850b167 100644 --- a/tooling/cli/templates/plugin/with-api/.github/workflows/test.yml +++ b/tooling/cli/templates/plugin/with-api/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - name: Install Linux dependencies run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 + sudo apt-get install -y webkit2gtk-4.1 - uses: Swatinem/rust-cache@v2 diff --git a/tooling/cli/templates/plugin/with-api/Cargo.crate-manifest b/tooling/cli/templates/plugin/with-api/Cargo.crate-manifest index d3ed73625b3..10529fa2ed7 100644 --- a/tooling/cli/templates/plugin/with-api/Cargo.crate-manifest +++ b/tooling/cli/templates/plugin/with-api/Cargo.crate-manifest @@ -4,7 +4,7 @@ version = "0.0.0" authors = [ "{{ author }}" ] description = "" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" exclude = ["/examples", "/webview-dist", "/webview-src", "node_modules"] [dependencies] diff --git a/tooling/cli/templates/plugin/with-api/examples/svelte-app/src-tauri/Cargo.crate-manifest b/tooling/cli/templates/plugin/with-api/examples/svelte-app/src-tauri/Cargo.crate-manifest index 74a685bdfd7..dc239129cb7 100644 --- a/tooling/cli/templates/plugin/with-api/examples/svelte-app/src-tauri/Cargo.crate-manifest +++ b/tooling/cli/templates/plugin/with-api/examples/svelte-app/src-tauri/Cargo.crate-manifest @@ -5,7 +5,7 @@ description = "A Tauri App" authors = [ "{{ author }}" ] repository = "" edition = "2021" -rust-version = "1.59" +rust-version = "1.64" [dependencies] serde_json = "1.0"