From 191e62c500132953ae57e46bb1e9f7b15f23daef Mon Sep 17 00:00:00 2001 From: quexeky Date: Mon, 4 Nov 2024 18:03:18 +1100 Subject: [PATCH] Allowing some dead code features because they are there for future use (potentially) Signed-off-by: quexeky --- src-tauri/src/downloads/progress.rs | 2 ++ src-tauri/src/lib.rs | 1 + src-tauri/src/tests/progress_tests.rs | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/downloads/progress.rs b/src-tauri/src/downloads/progress.rs index 4511558..720a05e 100644 --- a/src-tauri/src/downloads/progress.rs +++ b/src-tauri/src/downloads/progress.rs @@ -31,11 +31,13 @@ where capacity: capacity.into(), } } + #[allow(dead_code)] pub fn run_contexts_sequentially(&self, contexts: Vec) { for context in contexts { (self.f)(context, self.callback.clone(), self.counter.clone()); } } + #[allow(dead_code)] pub fn run_contexts_parallel_background(&self, contexts: Vec, max_threads: usize) { let threads = ThreadPoolBuilder::new() // If max_threads == 0, then the limit will be determined diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index c8806ef..9de8857 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -95,6 +95,7 @@ pub fn run() { let mut builder = tauri::Builder::default().plugin(tauri_plugin_dialog::init()); #[cfg(desktop)] + #[allow(unused_variables)] { builder = builder.plugin(tauri_plugin_single_instance::init(|_app, argv, _cwd| { // when defining deep link schemes at runtime, you must also check `argv` here diff --git a/src-tauri/src/tests/progress_tests.rs b/src-tauri/src/tests/progress_tests.rs index b855c9c..1d2df40 100644 --- a/src-tauri/src/tests/progress_tests.rs +++ b/src-tauri/src/tests/progress_tests.rs @@ -1,7 +1,7 @@ use atomic_counter::RelaxedCounter; use crate::downloads::progress::ProgressChecker; -use std::sync::atomic::{AtomicBool, AtomicUsize}; +use std::sync::atomic::AtomicBool; use std::sync::Arc; #[test] @@ -20,6 +20,6 @@ fn test_progress_parallel() { p.run_contexts_parallel_background((1..100).collect(), 10); } -fn test_fn(int: usize, callback: Arc, counter: Arc) { +fn test_fn(int: usize, _callback: Arc, _counter: Arc) { println!("{}", int); }