Revert "Propagate error from EventLoop creation" (#3010)
This reverts commit ed26dd58fd.
The patched was merged with a review by accident.
This commit is contained in:
parent
ed26dd58fd
commit
793c535b01
57 changed files with 291 additions and 344 deletions
20
src/error.rs
20
src/error.rs
|
|
@ -30,7 +30,7 @@ pub struct OsError {
|
|||
|
||||
/// A general error that may occur while running the Winit event loop
|
||||
#[derive(Debug)]
|
||||
pub enum EventLoopError {
|
||||
pub enum RunLoopError {
|
||||
/// The operation is not supported by the backend.
|
||||
NotSupported(NotSupportedError),
|
||||
/// The OS cannot perform the operation.
|
||||
|
|
@ -41,12 +41,6 @@ pub enum EventLoopError {
|
|||
ExitFailure(i32),
|
||||
}
|
||||
|
||||
impl From<OsError> for EventLoopError {
|
||||
fn from(value: OsError) -> Self {
|
||||
Self::Os(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl NotSupportedError {
|
||||
#[inline]
|
||||
#[allow(dead_code)]
|
||||
|
|
@ -100,13 +94,13 @@ impl fmt::Display for NotSupportedError {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for EventLoopError {
|
||||
impl fmt::Display for RunLoopError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
|
||||
match self {
|
||||
EventLoopError::AlreadyRunning => write!(f, "EventLoop is already running"),
|
||||
EventLoopError::NotSupported(e) => e.fmt(f),
|
||||
EventLoopError::Os(e) => e.fmt(f),
|
||||
EventLoopError::ExitFailure(status) => write!(f, "Exit Failure: {status}"),
|
||||
RunLoopError::AlreadyRunning => write!(f, "EventLoop is already running"),
|
||||
RunLoopError::NotSupported(e) => e.fmt(f),
|
||||
RunLoopError::Os(e) => e.fmt(f),
|
||||
RunLoopError::ExitFailure(status) => write!(f, "Exit Failure: {status}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -114,7 +108,7 @@ impl fmt::Display for EventLoopError {
|
|||
impl error::Error for OsError {}
|
||||
impl error::Error for ExternalError {}
|
||||
impl error::Error for NotSupportedError {}
|
||||
impl error::Error for EventLoopError {}
|
||||
impl error::Error for RunLoopError {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue