mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Forbid uses of unwrap() in the code (#7795)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps
|
||||
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use eframe::{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Demo app for egui
|
||||
#![allow(clippy::missing_errors_doc)]
|
||||
|
||||
mod apps;
|
||||
mod backend_panel;
|
||||
|
||||
@@ -31,6 +31,9 @@ impl WebHandle {
|
||||
}
|
||||
|
||||
/// Call this once from JavaScript to start your app.
|
||||
///
|
||||
/// # Errors
|
||||
/// Returns an error if the app could not start.
|
||||
#[wasm_bindgen]
|
||||
pub async fn start(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user