Change ContextCreationFailed to GraphicsCreationFailed

This commit is contained in:
Richard 2022-04-26 19:28:04 -03:00
parent 005e516b5e
commit 18ecec2bbd
3 changed files with 12 additions and 12 deletions

View file

@ -94,16 +94,16 @@ where
Error::WindowCreationFailed(error) Error::WindowCreationFailed(error)
} }
CreationError::OpenGlVersionNotSupported => { CreationError::OpenGlVersionNotSupported => {
Error::ContextCreationFailed( Error::GraphicsCreationFailed(
ContextError::VersionNotSupported, ContextError::VersionNotSupported,
) )
} }
CreationError::NoAvailablePixelFormat => { CreationError::NoAvailablePixelFormat => {
Error::ContextCreationFailed( Error::GraphicsCreationFailed(
ContextError::NoAvailablePixelFormat, ContextError::NoAvailablePixelFormat,
) )
} }
error => Error::ContextCreationFailed( error => Error::GraphicsCreationFailed(
ContextError::BackendError(error.to_string()), ContextError::BackendError(error.to_string()),
), ),
} }

View file

@ -11,9 +11,9 @@ pub enum Error {
#[error("the application window could not be created")] #[error("the application window could not be created")]
WindowCreationFailed(Box<dyn std::error::Error + Send + Sync>), WindowCreationFailed(Box<dyn std::error::Error + Send + Sync>),
/// The application context could not be created. /// The application graphics context could not be created.
#[error("the application context could not be created")] #[error("the application graphics context could not be created")]
ContextCreationFailed(iced_graphics::Error), GraphicsCreationFailed(iced_graphics::Error),
} }
impl From<iced_winit::Error> for Error { impl From<iced_winit::Error> for Error {
@ -25,8 +25,8 @@ impl From<iced_winit::Error> for Error {
iced_winit::Error::WindowCreationFailed(error) => { iced_winit::Error::WindowCreationFailed(error) => {
Error::WindowCreationFailed(Box::new(error)) Error::WindowCreationFailed(Box::new(error))
} }
iced_winit::Error::ContextCreationFailed(error) => { iced_winit::Error::GraphicsCreationFailed(error) => {
Error::ContextCreationFailed(error) Error::GraphicsCreationFailed(error)
} }
} }
} }

View file

@ -11,13 +11,13 @@ pub enum Error {
#[error("the application window could not be created")] #[error("the application window could not be created")]
WindowCreationFailed(winit::error::OsError), WindowCreationFailed(winit::error::OsError),
/// The application context could not be created. /// The application graphics context could not be created.
#[error("the application context could not be created")] #[error("the application graphics context could not be created")]
ContextCreationFailed(iced_graphics::Error), GraphicsCreationFailed(iced_graphics::Error),
} }
impl From<iced_graphics::Error> for Error { impl From<iced_graphics::Error> for Error {
fn from(error: iced_graphics::Error) -> Error { fn from(error: iced_graphics::Error) -> Error {
Error::ContextCreationFailed(error) Error::GraphicsCreationFailed(error)
} }
} }