mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 23:13:13 -04:00
Forbid uses of unwrap() in the code (#7795)
This commit is contained in:
@@ -376,6 +376,7 @@ impl EpiIntegration {
|
||||
|
||||
fn load_default_egui_icon() -> egui::IconData {
|
||||
profiling::function_scope!();
|
||||
#[expect(clippy::unwrap_used)]
|
||||
crate::icon_data::from_png_bytes(&include_bytes!("../../data/icon.png")[..]).unwrap()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
//! There is a bunch of improvements we could do,
|
||||
//! like removing a bunch of `unwraps`.
|
||||
|
||||
#![allow(clippy::undocumented_unsafe_blocks)]
|
||||
#![expect(clippy::undocumented_unsafe_blocks)]
|
||||
#![expect(clippy::unwrap_used)]
|
||||
|
||||
use std::{cell::RefCell, num::NonZeroU32, rc::Rc, sync::Arc, time::Instant};
|
||||
|
||||
|
||||
@@ -27,7 +27,10 @@ pub fn create_egui_context(storage: Option<&dyn crate::Storage>) -> egui::Contex
|
||||
|
||||
egui_ctx.options_mut(|o| {
|
||||
// eframe supports multi-pass (Context::request_discard).
|
||||
o.max_passes = 2.try_into().unwrap();
|
||||
#[expect(clippy::unwrap_used)]
|
||||
{
|
||||
o.max_passes = 2.try_into().unwrap();
|
||||
}
|
||||
});
|
||||
|
||||
let memory = crate::native::epi_integration::load_egui_memory(storage).unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user