From 1e62fdf069db5687be510e1cc375260bbff318a7 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 27 Jan 2022 04:00:53 -0300 Subject: Introduce `Error::ContextCreationFailed` --- winit/src/error.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'winit/src/error.rs') diff --git a/winit/src/error.rs b/winit/src/error.rs index 8e1d20e8..2dd045d2 100644 --- a/winit/src/error.rs +++ b/winit/src/error.rs @@ -11,17 +11,13 @@ pub enum Error { #[error("the application window could not be created")] WindowCreationFailed(winit::error::OsError), - /// A suitable graphics adapter or device could not be found. - #[error("a suitable graphics adapter or device could not be found")] - GraphicsAdapterNotFound, + /// The application context could not be created. + #[error("the application context could not be created")] + ContextCreationFailed(iced_graphics::Error), } impl From for Error { fn from(error: iced_graphics::Error) -> Error { - match error { - iced_graphics::Error::AdapterNotFound => { - Error::GraphicsAdapterNotFound - } - } + Error::ContextCreationFailed(error) } } -- cgit From 18ecec2bbd9478151b8c65df0644278a174d0847 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 26 Apr 2022 19:28:04 -0300 Subject: Change `ContextCreationFailed` to `GraphicsCreationFailed` --- winit/src/error.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'winit/src/error.rs') diff --git a/winit/src/error.rs b/winit/src/error.rs index 2dd045d2..eaeafd51 100644 --- a/winit/src/error.rs +++ b/winit/src/error.rs @@ -11,13 +11,13 @@ pub enum Error { #[error("the application window could not be created")] WindowCreationFailed(winit::error::OsError), - /// The application context could not be created. - #[error("the application context could not be created")] - ContextCreationFailed(iced_graphics::Error), + /// The application graphics context could not be created. + #[error("the application graphics context could not be created")] + GraphicsCreationFailed(iced_graphics::Error), } impl From for Error { fn from(error: iced_graphics::Error) -> Error { - Error::ContextCreationFailed(error) + Error::GraphicsCreationFailed(error) } } -- cgit