mirror of
https://github.com/crate-ci/typos.git
synced 2026-10-18 01:45:12 +02:00
Merge pull request #1196 from epage/fix
fix(dictgen): Align trie write/access conditions
This commit is contained in:
@@ -34,7 +34,12 @@ pub struct DictTrie<V: 'static> {
|
||||
impl<V> DictTrie<V> {
|
||||
#[inline]
|
||||
pub fn find(&self, word: &'_ unicase::UniCase<&str>) -> Option<&'static V> {
|
||||
if word.is_ascii() {
|
||||
if word
|
||||
.into_inner()
|
||||
.as_bytes()
|
||||
.iter()
|
||||
.all(|b| b.is_ascii_alphabetic())
|
||||
{
|
||||
if self.range.contains(&word.len()) {
|
||||
self.find_ascii(word.as_bytes())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user