Make iced::Error Send + Sync
This commit is contained in:
parent
8d882d787e
commit
14d900d835
13
src/error.rs
13
src/error.rs
|
@ -9,7 +9,7 @@ pub enum Error {
|
||||||
|
|
||||||
/// The application window could not be created.
|
/// The application window could not be created.
|
||||||
#[error("the application window could not be created")]
|
#[error("the application window could not be created")]
|
||||||
WindowCreationFailed(Box<dyn std::error::Error>),
|
WindowCreationFailed(Box<dyn std::error::Error + Send + Sync>),
|
||||||
|
|
||||||
/// A suitable graphics adapter or device could not be found.
|
/// A suitable graphics adapter or device could not be found.
|
||||||
#[error("a suitable graphics adapter or device could not be found")]
|
#[error("a suitable graphics adapter or device could not be found")]
|
||||||
|
@ -32,3 +32,14 @@ impl From<iced_winit::Error> for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn assert_send_sync() {
|
||||||
|
fn _assert<T: Send + Sync>() {}
|
||||||
|
_assert::<Error>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue