diff --git a/common/src/assets/mod.rs b/common/src/assets/mod.rs index 8acc12d5b6..4b27dd9983 100644 --- a/common/src/assets/mod.rs +++ b/common/src/assets/mod.rs @@ -123,8 +123,7 @@ pub fn load<A: Asset + 'static>(specifier: &str) -> Result<Arc<A>, Error> { /// Function used to load assets from the filesystem or the cache and return a clone. pub fn load_cloned<A: Asset + Clone + 'static>(specifier: &str) -> Result<A, Error> { - let asset = load(specifier); - asset.map(|asset: Arc<A>| (*asset).clone()) + load::<A>(specifier).map(|asset| (*asset).clone()) } /// Function used to load essential assets from the filesystem or the cache. It will panic if the asset is not found. @@ -141,8 +140,7 @@ pub fn load_expect<A: Asset + 'static>(specifier: &str) -> Arc<A> { /// Function used to load essential assets from the filesystem or the cache and return a clone. It will panic if the asset is not found. pub fn load_expect_cloned<A: Asset + Clone + 'static>(specifier: &str) -> A { - let asset: Arc<A> = load_expect(specifier); - (*asset).clone() + load_expect::<A>(specifier).as_ref().clone() } /// Load an asset while registering it to be watched and reloaded when it changes diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index cd1d2c407e..17ad624b3d 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -8,7 +8,6 @@ use specs::{Component, FlaggedStorage}; use specs_idvs::IDVStorage; use std::fs::File; use std::io::BufReader; -use std::sync::Arc; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Tool {