diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 8ab1e6266b..c77d51f3dc 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -1,7 +1,7 @@ use crate::{assets, comp, npc, terrain}; +use hashbrown::HashMap; use lazy_static::lazy_static; use std::{ - collections::HashMap, fmt::{self, Display}, path::Path, str::FromStr, diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index ec803fcbde..a5f5f89e2f 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -1,8 +1,9 @@ use crate::uid::Uid; +use hashbrown::HashMap; use serde::{Deserialize, Serialize}; use specs::{Component, FlaggedStorage}; use specs_idvs::IdvStorage; -use std::{cmp::Ordering, collections::HashMap, time::Duration}; +use std::{cmp::Ordering, time::Duration}; /// De/buff Kind. /// This is used to determine what effects a buff will have diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index 497e40f0c9..d1a32225ca 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -5,8 +5,9 @@ use crate::{ assets::{self, Asset}, comp::CharacterAbility, }; +use hashbrown::HashMap; use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, fs::File, io::BufReader, time::Duration}; +use std::{fs::File, io::BufReader, time::Duration}; use tracing::error; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/common/src/comp/skills.rs b/common/src/comp/skills.rs index 6c552fee60..b31d30dfee 100644 --- a/common/src/comp/skills.rs +++ b/common/src/comp/skills.rs @@ -1,9 +1,7 @@ +use hashbrown::{HashMap, HashSet}; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; -use std::{ - collections::{HashMap, HashSet}, - hash::Hash, -}; +use std::hash::Hash; use tracing::warn; lazy_static! { diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 2a64a17e56..804765da2b 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -1,11 +1,12 @@ use super::SpriteKind; use crate::make_case_elim; use enum_iterator::IntoEnumIterator; +use hashbrown::HashMap; use lazy_static::lazy_static; use num_derive::FromPrimitive; use num_traits::FromPrimitive; use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, convert::TryFrom, fmt, ops::Deref}; +use std::{convert::TryFrom, fmt, ops::Deref}; use vek::*; make_case_elim!( diff --git a/common/src/terrain/sprite.rs b/common/src/terrain/sprite.rs index c50a9ffc29..2f91924b28 100644 --- a/common/src/terrain/sprite.rs +++ b/common/src/terrain/sprite.rs @@ -1,9 +1,10 @@ use crate::make_case_elim; use enum_iterator::IntoEnumIterator; +use hashbrown::HashMap; use lazy_static::lazy_static; use num_derive::FromPrimitive; use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, convert::TryFrom, fmt}; +use std::{convert::TryFrom, fmt}; make_case_elim!( sprite_kind, diff --git a/common/src/uid.rs b/common/src/uid.rs index cff2dc9664..22c5eb347f 100644 --- a/common/src/uid.rs +++ b/common/src/uid.rs @@ -1,10 +1,11 @@ +use hashbrown::HashMap; use serde::{Deserialize, Serialize}; use specs::{ saveload::{Marker, MarkerAllocator}, world::EntitiesRes, Component, Entity, FlaggedStorage, Join, ReadStorage, VecStorage, }; -use std::{collections::HashMap, fmt, u64}; +use std::{fmt, u64}; #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] pub struct Uid(pub u64); diff --git a/voxygen/anim/src/dyn_lib.rs b/voxygen/anim/src/dyn_lib.rs index 7f817f625f..71c12e90aa 100644 --- a/voxygen/anim/src/dyn_lib.rs +++ b/voxygen/anim/src/dyn_lib.rs @@ -1,3 +1,4 @@ +use hashbrown::HashSet; use lazy_static::lazy_static; use libloading::Library; use notify::{immediate_watcher, EventKind, RecursiveMode, Watcher}; @@ -147,7 +148,7 @@ pub fn init() { // "Debounces" events since I can't find the option to do this in the latest // `notify` thread::spawn(move || { - let mut modified_paths = std::collections::HashSet::new(); + let mut modified_paths = HashSet::new(); while let Ok(path) = reload_recv.recv() { modified_paths.insert(path); diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index a860fa05b9..00eae0ab1d 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -73,9 +73,10 @@ use conrod_core::{ widget::{self, Button, Image, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, }; +use hashbrown::HashMap; use specs::{Join, WorldExt}; use std::{ - collections::{HashMap, VecDeque}, + collections::VecDeque, sync::Arc, time::{Duration, Instant}, }; diff --git a/voxygen/src/i18n.rs b/voxygen/src/i18n.rs index 13e34dc0c0..11eb66cab7 100644 --- a/voxygen/src/i18n.rs +++ b/voxygen/src/i18n.rs @@ -1,12 +1,9 @@ use common::assets::{self, Asset}; use deunicode::deunicode; +use hashbrown::{HashMap, HashSet}; use ron::de::from_reader; use serde::{Deserialize, Serialize}; -use std::{ - collections::{HashMap, HashSet}, - fs::File, - io::BufReader, -}; +use std::{fs::File, io::BufReader}; use tracing::warn; /// The reference language, aka the more up-to-date localization data. @@ -177,9 +174,9 @@ pub fn i18n_asset_key(language_id: &str) -> String { "voxygen.i18n.".to_string() mod tests { use super::Localization; use git2::Repository; + use hashbrown::{HashMap, HashSet}; use ron::de::{from_bytes, from_reader}; use std::{ - collections::{HashMap, HashSet}, fs, path::{Path, PathBuf}, }; diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index f7610e342b..7160504c0a 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -9,8 +9,9 @@ use common::{ terrain::{structure::Structure, Block, BlockKind}, vol::ReadVol, }; +use hashbrown::HashMap; use lazy_static::lazy_static; -use std::{collections::HashMap, f32, sync::Arc}; +use std::{f32, sync::Arc}; use vek::*; lazy_static! {