Merge branch 'james/hashbrown' into 'master'

Switch from std to hashbrown

See merge request veloren/veloren!1621
This commit is contained in:
Marcel
2020-12-17 10:55:13 +00:00
11 changed files with 22 additions and 19 deletions

View File

@ -1,7 +1,7 @@
use crate::{assets, comp, npc, terrain}; use crate::{assets, comp, npc, terrain};
use hashbrown::HashMap;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::{ use std::{
collections::HashMap,
fmt::{self, Display}, fmt::{self, Display},
path::Path, path::Path,
str::FromStr, str::FromStr,

View File

@ -1,8 +1,9 @@
use crate::uid::Uid; use crate::uid::Uid;
use hashbrown::HashMap;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use specs::{Component, FlaggedStorage}; use specs::{Component, FlaggedStorage};
use specs_idvs::IdvStorage; use specs_idvs::IdvStorage;
use std::{cmp::Ordering, collections::HashMap, time::Duration}; use std::{cmp::Ordering, time::Duration};
/// De/buff Kind. /// De/buff Kind.
/// This is used to determine what effects a buff will have /// This is used to determine what effects a buff will have

View File

@ -5,8 +5,9 @@ use crate::{
assets::{self, Asset}, assets::{self, Asset},
comp::CharacterAbility, comp::CharacterAbility,
}; };
use hashbrown::HashMap;
use serde::{Deserialize, Serialize}; 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; use tracing::error;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]

View File

@ -1,9 +1,7 @@
use hashbrown::{HashMap, HashSet};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{ use std::hash::Hash;
collections::{HashMap, HashSet},
hash::Hash,
};
use tracing::warn; use tracing::warn;
lazy_static! { lazy_static! {

View File

@ -1,11 +1,12 @@
use super::SpriteKind; use super::SpriteKind;
use crate::make_case_elim; use crate::make_case_elim;
use enum_iterator::IntoEnumIterator; use enum_iterator::IntoEnumIterator;
use hashbrown::HashMap;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use num_derive::FromPrimitive; use num_derive::FromPrimitive;
use num_traits::FromPrimitive; use num_traits::FromPrimitive;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{collections::HashMap, convert::TryFrom, fmt, ops::Deref}; use std::{convert::TryFrom, fmt, ops::Deref};
use vek::*; use vek::*;
make_case_elim!( make_case_elim!(

View File

@ -1,9 +1,10 @@
use crate::make_case_elim; use crate::make_case_elim;
use enum_iterator::IntoEnumIterator; use enum_iterator::IntoEnumIterator;
use hashbrown::HashMap;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use num_derive::FromPrimitive; use num_derive::FromPrimitive;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{collections::HashMap, convert::TryFrom, fmt}; use std::{convert::TryFrom, fmt};
make_case_elim!( make_case_elim!(
sprite_kind, sprite_kind,

View File

@ -1,10 +1,11 @@
use hashbrown::HashMap;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use specs::{ use specs::{
saveload::{Marker, MarkerAllocator}, saveload::{Marker, MarkerAllocator},
world::EntitiesRes, world::EntitiesRes,
Component, Entity, FlaggedStorage, Join, ReadStorage, VecStorage, 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)] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Uid(pub u64); pub struct Uid(pub u64);

View File

@ -1,3 +1,4 @@
use hashbrown::HashSet;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use libloading::Library; use libloading::Library;
use notify::{immediate_watcher, EventKind, RecursiveMode, Watcher}; 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 // "Debounces" events since I can't find the option to do this in the latest
// `notify` // `notify`
thread::spawn(move || { thread::spawn(move || {
let mut modified_paths = std::collections::HashSet::new(); let mut modified_paths = HashSet::new();
while let Ok(path) = reload_recv.recv() { while let Ok(path) = reload_recv.recv() {
modified_paths.insert(path); modified_paths.insert(path);

View File

@ -73,9 +73,10 @@ use conrod_core::{
widget::{self, Button, Image, Text}, widget::{self, Button, Image, Text},
widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget,
}; };
use hashbrown::HashMap;
use specs::{Join, WorldExt}; use specs::{Join, WorldExt};
use std::{ use std::{
collections::{HashMap, VecDeque}, collections::VecDeque,
sync::Arc, sync::Arc,
time::{Duration, Instant}, time::{Duration, Instant},
}; };

View File

@ -1,12 +1,9 @@
use common::assets::{self, Asset}; use common::assets::{self, Asset};
use deunicode::deunicode; use deunicode::deunicode;
use hashbrown::{HashMap, HashSet};
use ron::de::from_reader; use ron::de::from_reader;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{ use std::{fs::File, io::BufReader};
collections::{HashMap, HashSet},
fs::File,
io::BufReader,
};
use tracing::warn; use tracing::warn;
/// The reference language, aka the more up-to-date localization data. /// 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 { mod tests {
use super::Localization; use super::Localization;
use git2::Repository; use git2::Repository;
use hashbrown::{HashMap, HashSet};
use ron::de::{from_bytes, from_reader}; use ron::de::{from_bytes, from_reader};
use std::{ use std::{
collections::{HashMap, HashSet},
fs, fs,
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };

View File

@ -9,8 +9,9 @@ use common::{
terrain::{structure::Structure, Block, BlockKind}, terrain::{structure::Structure, Block, BlockKind},
vol::ReadVol, vol::ReadVol,
}; };
use hashbrown::HashMap;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::{collections::HashMap, f32, sync::Arc}; use std::{f32, sync::Arc};
use vek::*; use vek::*;
lazy_static! { lazy_static! {