Skip to content

Commit

Permalink
Merge pull request #719 from taiki-e/error-send-sync
Browse files Browse the repository at this point in the history
Make iced::Error Send + Sync
  • Loading branch information
hecrj authored Jan 29, 2021
2 parents 8d882d7 + 14d900d commit c7898a1
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 c7898a1

Please sign in to comment.