1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Forbid uses of unwrap() in the code (#7795)

This commit is contained in:
Emil Ernerfeldt
2025-12-19 20:34:18 +01:00
committed by GitHub
parent 646fea2133
commit 7fe58bbfd4
44 changed files with 120 additions and 64 deletions

View File

@@ -459,11 +459,13 @@ fn call_after_delay(delay: std::time::Duration, f: impl FnOnce() + Send + 'stati
std::thread::sleep(delay);
f();
})
.unwrap();
.expect("Failed to spawn a thread");
}
#[cfg(target_arch = "wasm32")]
fn call_after_delay(delay: std::time::Duration, f: impl FnOnce() + Send + 'static) {
#![expect(clippy::unwrap_used)]
use wasm_bindgen::prelude::*;
let window = web_sys::window().unwrap();
let closure = Closure::once(f);