meilisearch/crates/milli/src/search/new/matches/simple_token_kind.rs

16 lines
361 B
Rust
Raw Normal View History

2024-10-03 15:37:51 +03:00
use charabia::{SeparatorKind, Token, TokenKind};
pub enum SimpleTokenKind {
Separator(SeparatorKind),
NotSeparator,
}
impl SimpleTokenKind {
pub fn new(token: &&Token<'_>) -> Self {
match token.kind {
TokenKind::Separator(separaor_kind) => Self::Separator(separaor_kind),
_ => Self::NotSeparator,
}
}
}