Switched from rustc-hash with ahash
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
use crate::prelude::*;
|
||||
use itertools::Itertools;
|
||||
use rustc_hash::FxHashSet;
|
||||
use std::{fmt::Write, path::Path};
|
||||
use teloxide::{
|
||||
net::Download,
|
||||
@ -47,7 +46,7 @@ async fn download_file(bot: &Throttle<Bot>, file: &FileMeta) -> crate::Result<Ve
|
||||
#[inline]
|
||||
fn process_accounts(
|
||||
accounts: &mut [DecryptedAccount],
|
||||
existing_names: FxHashSet<String>,
|
||||
existing_names: ahash::HashSet<String>,
|
||||
) -> crate::Result<Result<(), String>> {
|
||||
for account in accounts.iter_mut() {
|
||||
account.name.trim_in_place();
|
||||
@ -119,7 +118,7 @@ fn process_accounts(
|
||||
#[inline]
|
||||
fn user_from_vec(
|
||||
vector: Vec<u8>,
|
||||
existing_names: FxHashSet<String>,
|
||||
existing_names: ahash::HashSet<String>,
|
||||
) -> crate::Result<Result<User, String>> {
|
||||
let mut user: User = serde_json::from_slice(&vector)?;
|
||||
drop(vector);
|
||||
@ -168,7 +167,7 @@ pub async fn get_user(
|
||||
let existing_names = async {
|
||||
Account::get_names(user_id, &db)
|
||||
.await?
|
||||
.try_collect::<FxHashSet<_>>()
|
||||
.try_collect()
|
||||
.await
|
||||
.map_err(Into::into)
|
||||
};
|
||||
|
Reference in New Issue
Block a user