Skip to content

Commit

Permalink
Make iced::Error Send + Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 29, 2021
1 parent 8d882d7 commit 14d900d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub enum 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.
#[error("a suitable graphics adapter or device could not be found")]
Expand All @@ -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>();
}
}

0 comments on commit 14d900d

Please sign in to comment.