Move the rayon thread pool outside the extract method

This commit is contained in:
Clément Renault 2024-11-14 10:40:32 +01:00
parent 0e3c5d91ab
commit 9e8367f1e6
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
10 changed files with 328 additions and 291 deletions

View file

@ -3,6 +3,9 @@ mod r#match;
mod matching_words;
mod simple_token_kind;
use std::borrow::Cow;
use std::cmp::{max, min};
use charabia::{Language, SeparatorKind, Token, Tokenizer};
use either::Either;
pub use matching_words::MatchingWords;
@ -10,10 +13,6 @@ use matching_words::{MatchType, PartialMatch};
use r#match::{Match, MatchPosition};
use serde::Serialize;
use simple_token_kind::SimpleTokenKind;
use std::{
borrow::Cow,
cmp::{max, min},
};
const DEFAULT_CROP_MARKER: &str = "";
const DEFAULT_HIGHLIGHT_PREFIX: &str = "<em>";