Merge pull request #2197 from tzemanovic/wgpu-renderer-send

wgpu: require `Send` on stored pipelines
This commit is contained in:
Héctor Ramón 2024-01-11 17:07:48 +01:00 committed by GitHub
commit 89fc4f54bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,7 +82,7 @@ impl<Theme> Renderer for crate::Renderer<Theme> {
/// Stores custom, user-provided pipelines.
#[derive(Default, Debug)]
pub struct Storage {
pipelines: HashMap<TypeId, Box<dyn Any>>,
pipelines: HashMap<TypeId, Box<dyn Any + Send>>,
}
impl Storage {
@ -92,7 +92,7 @@ impl Storage {
}
/// Inserts the pipeline `T` in to [`Storage`].
pub fn store<T: 'static>(&mut self, pipeline: T) {
pub fn store<T: 'static + Send>(&mut self, pipeline: T) {
let _ = self.pipelines.insert(TypeId::of::<T>(), Box::new(pipeline));
}