mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
Forbid uses of unwrap() in the code (#7795)
This commit is contained in:
@@ -281,7 +281,12 @@ impl Mesh {
|
||||
let mesh = Mesh16 {
|
||||
indices: self.indices[span_start..index_cursor]
|
||||
.iter()
|
||||
.map(|vi| u16::try_from(vi - min_vindex).unwrap())
|
||||
.map(|vi| {
|
||||
#[expect(clippy::unwrap_used)]
|
||||
{
|
||||
u16::try_from(vi - min_vindex).unwrap()
|
||||
}
|
||||
})
|
||||
.collect(),
|
||||
vertices: self.vertices[(min_vindex as usize)..=(max_vindex as usize)].to_vec(),
|
||||
texture_id: self.texture_id,
|
||||
|
||||
@@ -1403,6 +1403,7 @@ impl Tessellator {
|
||||
});
|
||||
}
|
||||
|
||||
#[expect(clippy::unwrap_used)] // it's never empty
|
||||
let out = out_primitives.last_mut().unwrap();
|
||||
|
||||
if let Primitive::Mesh(out_mesh) = &mut out.primitive {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![expect(clippy::unwrap_used)] // TODO(emilk): remove unwraps
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use emath::{Align, GuiRounding as _, NumExt as _, Pos2, Rect, Vec2, pos2, vec2};
|
||||
|
||||
Reference in New Issue
Block a user