anyhow context is nice

This commit is contained in:
galister
2025-12-10 21:03:13 +09:00
parent 7c41a01122
commit c4b8fbd579
8 changed files with 29 additions and 25 deletions

View File

@@ -1,3 +1,4 @@
use anyhow::Context;
use glam::FloatExt;
use wgui::{
animation::{Animation, AnimationEasing},
@@ -24,7 +25,7 @@ impl InteractLockHandler {
.state
.widgets
.get_as::<WidgetRectangle>(id)
.ok_or_else(|| anyhow::anyhow!("Element with id=\"shadow\" must be a <rectangle>"))?;
.context("Element with id=\"shadow\" must be a <rectangle>")?;
Ok(Self {
id,

View File

@@ -1,3 +1,4 @@
use anyhow::Context;
use glam::{vec3, Affine2, Affine3A, Quat, Vec3};
use smallvec::smallvec;
use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc};
@@ -677,7 +678,7 @@ impl OverlayBackend for WayVRBackend {
.data
.state
.get_render_data(ctx.display)
.ok_or_else(|| anyhow::anyhow!("Failed to fetch render data"))?
.context("Failed to fetch render data")?
.clone();
drop(wayvr);