Add Send + Sync bounds for user-defined errors (#197)
- This enables compatibility with anyhow and the async ecosystem
This commit is contained in:
parent
db00a67c60
commit
50c77a5f83
|
@ -117,9 +117,11 @@ pub enum Error {
|
|||
Surface(wgpu::SurfaceError),
|
||||
/// User-defined error from custom render function
|
||||
#[error("User-defined error.")]
|
||||
UserDefined(#[from] Box<dyn std::error::Error>),
|
||||
UserDefined(#[from] DynError),
|
||||
}
|
||||
|
||||
type DynError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
||||
|
||||
impl<'win, W: HasRawWindowHandle> SurfaceTexture<'win, W> {
|
||||
/// Create a logical texture for a window surface.
|
||||
///
|
||||
|
@ -357,7 +359,7 @@ impl Pixels {
|
|||
&mut wgpu::CommandEncoder,
|
||||
&wgpu::TextureView,
|
||||
&PixelsContext,
|
||||
) -> Result<(), Box<dyn std::error::Error>>,
|
||||
) -> Result<(), DynError>,
|
||||
{
|
||||
let frame = self
|
||||
.context
|
||||
|
|
Loading…
Reference in a new issue