refactor: switch from chrono to jiff
This commit is contained in:
parent
79a054ab40
commit
3ffdf8f0d7
12 changed files with 205 additions and 161 deletions
|
|
@ -74,7 +74,7 @@ impl MentionHost<'_> {
|
|||
}
|
||||
|
||||
impl Switchboard {
|
||||
pub async fn gen_trie(pool: &SqlitePool) -> Result<radix_trie::Trie<String,String>, AppError> {
|
||||
pub async fn gen_trie(pool: &SqlitePool) -> Result<radix_trie::Trie<String, String>, AppError> {
|
||||
let mut trie = radix_trie::Trie::new();
|
||||
|
||||
let mentionables = sqlx::query_as!(
|
||||
|
|
@ -109,14 +109,6 @@ impl Switchboard {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn remove(self: &mut Self, text: &String) {
|
||||
self.trie.remove(text);
|
||||
}
|
||||
|
||||
pub fn add_mentionable(self: &mut Self, text: String, uri: String) {
|
||||
self.trie.insert(text, uri);
|
||||
}
|
||||
|
||||
pub fn extract_mentions<'a>(&self, host: impl Into<MentionHost<'a>>) -> HashSet<Mention> {
|
||||
let host: MentionHost = host.into();
|
||||
let name_re = Regex::new(r"\[\[(.+?)\]\]").unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue