use once_cell
This commit is contained in:
parent
337fbba312
commit
aaf2ab3634
|
@ -1100,7 +1100,6 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"futures",
|
||||
"futures-util",
|
||||
"lazy_static",
|
||||
"once_cell",
|
||||
"rand 0.8.5",
|
||||
"serde",
|
||||
|
|
|
@ -12,5 +12,4 @@ serde_json = "1.0.68"
|
|||
tokio = { version = "1.12.0", features = ["full"] }
|
||||
tokio-stream = { version = "0.1.7", features = ["fs"] }
|
||||
warp = "0.3.1"
|
||||
lazy_static = "1.4.0"
|
||||
rand = "0.8.5"
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::prelude::SliceRandom;
|
||||
|
||||
|
||||
|
||||
const PLURALNOUN: [&'static str; 2847] = [
|
||||
"Abilities",
|
||||
"Absences",
|
||||
|
@ -5626,18 +5625,14 @@ const PATTERNS: [&str; 1] = [
|
|||
// "_ADJECTIVE__PLURALNOUN_AtThe_PLACE_",
|
||||
];
|
||||
|
||||
|
||||
|
||||
lazy_static! {
|
||||
static ref CATEGORIES: HashMap<&'static str, Vec<&'static str>> = {
|
||||
let mut categories = HashMap::new();
|
||||
categories.insert("_PLURALNOUN_", Vec::from(PLURALNOUN));
|
||||
categories.insert("_VERB_", Vec::from(VERB));
|
||||
categories.insert("_ADVERB_", Vec::from(ADVERB));
|
||||
categories.insert("_ADJECTIVE_", Vec::from(ADJECTIVE));
|
||||
categories
|
||||
};
|
||||
}
|
||||
static CATEGORIES: Lazy<HashMap<&'static str, Vec<&'static str>>> = Lazy::new(|| {
|
||||
let mut categories = HashMap::new();
|
||||
categories.insert("_PLURALNOUN_", Vec::from(PLURALNOUN));
|
||||
categories.insert("_VERB_", Vec::from(VERB));
|
||||
categories.insert("_ADVERB_", Vec::from(ADVERB));
|
||||
categories.insert("_ADJECTIVE_", Vec::from(ADJECTIVE));
|
||||
categories
|
||||
});
|
||||
|
||||
// export function generateRoomWithoutSeparator() {
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
use serde_json::json;
|
||||
use std::net::IpAddr;
|
||||
|
||||
|
|
Loading…
Reference in New Issue