Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

fix(ci): loosen the autoclick sleep test and drop two Windows-only needless returns

tonhowtf73299973c7cc
diff --git a/src-tauri/omniget-core/src/core/tools/autoclick.rs b/src-tauri/omniget-core/src/core/tools/autoclick.rs
index 1f00df78..7eb1f23a 100644
--- a/src-tauri/omniget-core/src/core/tools/autoclick.rs
+++ b/src-tauri/omniget-core/src/core/tools/autoclick.rs
@@ -220,8 +220,11 @@ mod tests {
let t = Instant::now();
sleep_until(t + Duration::from_millis(5));
let e = t.elapsed();
+ // The lower bound is the contract. The upper bound only guards against a
+ // sleep that never wakes; CI runners can stall a thread for far longer
+ // than the 20 ms a desktop machine takes, so it is deliberately loose.
assert!(
- e >= Duration::from_millis(5) && e < Duration::from_millis(25),
+ e >= Duration::from_millis(5) && e < Duration::from_millis(500),
"{:?}",
e
);
diff --git a/src-tauri/omniget-core/src/core/tools/file_search.rs b/src-tauri/omniget-core/src/core/tools/file_search.rs
index 3f2d329c..6d09d89e 100644
--- a/src-tauri/omniget-core/src/core/tools/file_search.rs
+++ b/src-tauri/omniget-core/src/core/tools/file_search.rs
@@ -36,12 +36,12 @@ pub async fn backend() -> SearchBackend {
#[cfg(target_os = "windows")]
{
let p = es_path().await;
- return SearchBackend {
+ SearchBackend {
name: "Everything".into(),
available: p.is_some(),
path: p.map(|p| p.to_string_lossy().to_string()),
install_hint: "winget install voidtools.Everything voidtools.Everything.Cli".into(),
- };
+ }
}
#[cfg(target_os = "macos")]
{
diff --git a/src-tauri/omniget-core/src/core/tools/win_tweaks.rs b/src-tauri/omniget-core/src/core/tools/win_tweaks.rs
index b4baa606..52ec0866 100644
--- a/src-tauri/omniget-core/src/core/tools/win_tweaks.rs
+++ b/src-tauri/omniget-core/src/core/tools/win_tweaks.rs
@@ -576,11 +576,11 @@ pub async fn status() -> TweaksStatus {
for rule in rules.iter_mut() {
rule.applied = reg_query(&rule.key, &rule.name).await.map(|v| v == rule.on);
}
- return TweaksStatus {
+ TweaksStatus {
supported: true,
is_admin: is_admin().await,
rules,
- };
+ }
}
#[cfg(not(target_os = "windows"))]
{