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,9 +1,9 @@
|
||||
//! Example how to use pure `egui_glow`.
|
||||
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
|
||||
#![allow(clippy::undocumented_unsafe_blocks)]
|
||||
#![allow(unsafe_code)]
|
||||
#![expect(rustdoc::missing_crate_level_docs, clippy::unwrap_used)] // it's an example
|
||||
#![expect(clippy::undocumented_unsafe_blocks)]
|
||||
#![expect(unsafe_code)]
|
||||
|
||||
use std::num::NonZeroU32;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#![allow(clippy::collapsible_else_if)]
|
||||
#![allow(clippy::unwrap_used)]
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#![allow(unsafe_code)]
|
||||
#![allow(clippy::undocumented_unsafe_blocks)]
|
||||
#![expect(clippy::undocumented_unsafe_blocks)]
|
||||
#![expect(clippy::unwrap_used)] // TODO(emilk): avoid unwraps
|
||||
#![expect(unsafe_code)]
|
||||
|
||||
use std::convert::TryInto as _;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#![allow(unsafe_code)]
|
||||
#![expect(unsafe_code)]
|
||||
#![expect(clippy::unwrap_used)]
|
||||
|
||||
use glow::HasContext as _;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ impl EguiGlow {
|
||||
native_pixels_per_point: Option<f32>,
|
||||
dithering: bool,
|
||||
) -> Self {
|
||||
#[expect(clippy::unwrap_used)] // TODO(emilk): return error instead of unwrap
|
||||
let painter = crate::Painter::new(gl, "", shader_version, dithering)
|
||||
.map_err(|err| {
|
||||
log::error!("error occurred in initializing painter:\n{err}");
|
||||
|
||||
Reference in New Issue
Block a user