Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NarHakobyan committed Feb 10, 2025
1 parent 99f1841 commit d929c01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions charabia/src/normalizer/lowercase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ impl CharNormalizer for LowercaseNormalizer {

fn should_normalize(&self, token: &Token) -> bool {
// https://en.wikipedia.org/wiki/Letter_case#Capitalisation
matches!(token.script, Script::Latin | Script::Cyrillic | Script::Greek | Script::Georgian | Script::Armenian)
&& token.lemma.chars().any(char::is_uppercase)
matches!(
token.script,
Script::Latin | Script::Cyrillic | Script::Greek | Script::Georgian | Script::Armenian
) && token.lemma.chars().any(char::is_uppercase)
}
}

Expand Down
2 changes: 1 addition & 1 deletion charabia/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Token<'_> {

/// Returns true if the current token is a separator.
pub fn is_separator(&self) -> bool {
self.separator_kind().map_or(false, |_| true)
self.separator_kind().is_some_and(|_| true)
}

/// Returns Some([`SeparatorKind`]) if the token is a separator and None if it's a word or a stop word.
Expand Down

0 comments on commit d929c01

Please sign in to comment.