From 7699a1f498dd41d9abfc907d36e37dfed7a761c0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 23 Apr 2026 03:04:25 +0200 Subject: refactor(opengl-bindings): change Error enum into struct MakeContextCurrentError --- opengl-bindings/src/lib.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/opengl-bindings/src/lib.rs b/opengl-bindings/src/lib.rs index e5051d5..cfdfa35 100644 --- a/opengl-bindings/src/lib.rs +++ b/opengl-bindings/src/lib.rs @@ -31,11 +31,11 @@ impl ContextWithFns pub fn new( context: NotCurrentContext, surface: &Surface, - ) -> Result + ) -> Result { let context = context .make_current(surface) - .map_err(Error::MakeContextCurrentFailed)?; + .map_err(MakeContextCurrentError)?; let display = context.display(); @@ -58,12 +58,12 @@ impl ContextWithFns pub fn make_current( &self, surface: &Surface, - ) -> Result, Error> + ) -> Result, MakeContextCurrentError> { if !self.context.is_current() || !surface.is_current(&self.context) { self.context .make_current(surface) - .map_err(Error::MakeContextCurrentFailed)?; + .map_err(MakeContextCurrentError)?; } Ok(CurrentContextWithFns { ctx: self }) @@ -97,11 +97,8 @@ impl CurrentContextWithFns<'_> } #[derive(Debug, thiserror::Error)] -pub enum Error -{ - #[error("Failed to make context current")] - MakeContextCurrentFailed(#[source] glutin::error::Error), -} +#[error("Failed to make context current")] +pub struct MakeContextCurrentError(#[source] glutin::error::Error); mod sys { -- cgit v1.2.3-18-g5258