send+sync

This commit is contained in:
Robin Appelman 2023-12-26 17:22:27 +01:00
commit 4476c0f986
3 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View file

@ -613,7 +613,7 @@ dependencies = [
[[package]] [[package]]
name = "tf-asset-loader" name = "tf-asset-loader"
version = "0.1.2" version = "0.1.4"
dependencies = [ dependencies = [
"steamlocate", "steamlocate",
"thiserror", "thiserror",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "tf-asset-loader" name = "tf-asset-loader"
version = "0.1.3" version = "0.1.4"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
description = "Utility for loading assets from tf2 data files" description = "Utility for loading assets from tf2 data files"

View file

@ -24,7 +24,7 @@ pub enum LoaderError {
#[derive(Clone)] #[derive(Clone)]
pub struct Loader { pub struct Loader {
sources: Vec<Arc<dyn AssetSource>>, sources: Vec<Arc<dyn AssetSource + Send + Sync>>,
} }
impl Debug for Loader { impl Debug for Loader {
@ -58,11 +58,11 @@ impl Loader {
} }
res.ok() res.ok()
}) })
.map(|vpk| Arc::new(vpk) as Arc<dyn AssetSource>); .map(|vpk| Arc::new(vpk) as Arc<dyn AssetSource + Send + Sync>);
#[allow(unused_mut)] #[allow(unused_mut)]
let mut sources = vec![ let mut sources = vec![
Arc::new(tf_dir) as Arc<dyn AssetSource>, Arc::new(tf_dir) as Arc<dyn AssetSource + Send + Sync>,
Arc::new(download), Arc::new(download),
Arc::new(hl_dir), Arc::new(hl_dir),
]; ];
@ -73,7 +73,7 @@ impl Loader {
Ok(Loader { sources }) Ok(Loader { sources })
} }
pub fn add_source<S: AssetSource + 'static>(&mut self, source: S) { pub fn add_source<S: AssetSource + Send + Sync + 'static>(&mut self, source: S) {
self.sources.push(Arc::new(source)) self.sources.push(Arc::new(source))
} }