diff --git a/codegen/src/gen_dictionary.rs b/codegen/src/gen_dictionary.rs index 086820c..a56cf84 100644 --- a/codegen/src/gen_dictionary.rs +++ b/codegen/src/gen_dictionary.rs @@ -7,7 +7,7 @@ use rustypipe::timeago::TimeUnit; use crate::util; -const TARGET_PATH: &str = "src/dictionary.rs"; +const TARGET_PATH: &str = "src/util/dictionary.rs"; fn parse_tu(tu: &str) -> (u8, Option) { static TU_PATTERN: Lazy = Lazy::new(|| Regex::new(r"^(\d*)(\w?)$").unwrap()); diff --git a/src/lib.rs b/src/lib.rs index da09f6b..ab8848e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,6 @@ mod macros; mod deobfuscate; -mod dictionary; mod serializer; mod util; diff --git a/src/timeago.rs b/src/timeago.rs index b008bee..32e2f0f 100644 --- a/src/timeago.rs +++ b/src/timeago.rs @@ -20,7 +20,10 @@ use std::ops::Mul; use chrono::{DateTime, Duration, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone}; use serde::{Deserialize, Serialize}; -use crate::{dictionary, model::Language, util}; +use crate::{ + model::Language, + util::{self, dictionary}, +}; /// Parsed TimeAgo string, contains amount and time unit. /// diff --git a/src/dictionary.rs b/src/util/dictionary.rs similarity index 100% rename from src/dictionary.rs rename to src/util/dictionary.rs diff --git a/src/util/mod.rs b/src/util/mod.rs index 2928f63..e9369a4 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1,3 +1,5 @@ +pub mod dictionary; + use std::{borrow::Borrow, collections::BTreeMap, str::FromStr}; use fancy_regex::Regex; @@ -5,7 +7,7 @@ use once_cell::sync::Lazy; use rand::Rng; use url::Url; -use crate::{dictionary, error::Error, error::Result, model::Language}; +use crate::{error::Error, error::Result, model::Language}; const CONTENT_PLAYBACK_NONCE_ALPHABET: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";