fix: improved timeago performance
This commit is contained in:
parent
cc63477406
commit
500ea77788
8 changed files with 3064 additions and 1088 deletions
|
|
@ -164,7 +164,7 @@ async fn get_comment_datestrings(rp: &RustyTube, ctoken: &str) -> (Vec<String>,
|
|||
// #[test_log::test(tokio::test)]
|
||||
#[allow(dead_code)]
|
||||
async fn download_timeago_testfiles() {
|
||||
let json_path = Path::new("testfiles/date/timeago.json").to_path_buf();
|
||||
let json_path = Path::new("testfiles/date/timeago_samples.json").to_path_buf();
|
||||
if json_path.exists() {
|
||||
return;
|
||||
}
|
||||
|
|
@ -312,7 +312,7 @@ struct TimeagoTable {
|
|||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
struct TimeagoTableEntry {
|
||||
cases: BTreeMap<String, u32>,
|
||||
cases: BTreeMap<String, u8>,
|
||||
missing_plurals: HashSet<PluralCat>,
|
||||
}
|
||||
|
||||
|
|
|
|||
1682
src/dictionary.rs
Normal file
1682
src/dictionary.rs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -6,9 +6,10 @@ mod macros;
|
|||
mod cache;
|
||||
mod deobfuscate;
|
||||
mod serializer;
|
||||
mod timeago;
|
||||
mod util;
|
||||
mod dictionary;
|
||||
|
||||
pub mod client;
|
||||
pub mod download;
|
||||
pub mod model;
|
||||
pub mod timeago;
|
||||
|
|
|
|||
1130
src/timeago.rs
1130
src/timeago.rs
File diff suppressed because it is too large
Load diff
Reference in a new issue