From cb95cd89a97ff44aa1c7b74b636804bbac23ec43 Mon Sep 17 00:00:00 2001 From: hrzlgnm Date: Fri, 1 Nov 2024 18:47:41 +0100 Subject: [PATCH 1/2] chore: fix warning about unused import and remove unused dependecy --- Cargo.lock | 13 ------------- Cargo.toml | 1 - src-tauri/src/lib.rs | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5daf4df..f0515b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1840,18 +1840,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "gloo-utils" version = "0.2.0" @@ -3013,7 +3001,6 @@ dependencies = [ "console_error_panic_hook", "console_log", "futures", - "gloo-timers", "icondata", "js-sys", "leptos", diff --git a/Cargo.toml b/Cargo.toml index 61a2c4a..381f264 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ chrono = "0.4.38" console_error_panic_hook = "0.1.7" console_log = "1.0.0" futures = "0.3.30" -gloo-timers = { version = "0.3.0", features = ["futures"] } icondata = "0.4.0" js-sys = "0.3.70" leptos = { version = "0.6.15", features = ["csr"] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index c0489c3..e29af7d 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -4,7 +4,7 @@ use clap::builder::TypedValueParser as _; use clap::Parser; use mdns_sd::{ServiceDaemon, ServiceEvent, ServiceInfo}; use models::*; -#[cfg(not(debug_assertions))] +#[cfg(any(not(debug_assertions), desktop))] use shared_constants::SPLASH_SCREEN_DURATION; use shared_constants::{MDNS_SD_META_SERVICE, METRICS_CHECK_INTERVAL}; use std::{ From 8d2454a35140b760234e3eef2d893e1d75b8cc80 Mon Sep 17 00:00:00 2001 From: hrzlgnm Date: Fri, 1 Nov 2024 18:56:56 +0100 Subject: [PATCH 2/2] Treat warnings as errors --- .github/workflows/android.yml | 1 + .github/workflows/desktop-tauri.yml | 1 + src-tauri/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d894ec7..f618aa5 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -76,6 +76,7 @@ jobs: cargo --locked auditable tauri android build env: NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837 + RUSTFLAGS: "-D warnings" - name: 🔑 Extract android signing key from env (publish only) run: | diff --git a/.github/workflows/desktop-tauri.yml b/.github/workflows/desktop-tauri.yml index 3c75675..c72c96a 100644 --- a/.github/workflows/desktop-tauri.yml +++ b/.github/workflows/desktop-tauri.yml @@ -140,6 +140,7 @@ jobs: - name: 🔨 Build using tauri action (publish artifacts on release) uses: tauri-apps/tauri-action@8c3e0753aa015d00d03631d6d4f64ad59489251d # v0.5.15 env: + RUSTFLAGS: "-D warnings" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index e29af7d..23a8dce 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -4,7 +4,7 @@ use clap::builder::TypedValueParser as _; use clap::Parser; use mdns_sd::{ServiceDaemon, ServiceEvent, ServiceInfo}; use models::*; -#[cfg(any(not(debug_assertions), desktop))] +#[cfg(any(not(debug_assertions), not(desktop)))] use shared_constants::SPLASH_SCREEN_DURATION; use shared_constants::{MDNS_SD_META_SERVICE, METRICS_CHECK_INTERVAL}; use std::{