Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit b3b1abc

Browse files
committed
style(milli): linting
1 parent eb44261 commit b3b1abc

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

crates/milli/src/search/new/query_term/parse_query.rs

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -386,51 +386,56 @@ mod tests {
386386
let temp_index = temp_index_with_documents();
387387
let rtxn = temp_index.read_txn()?;
388388
let ctx = SearchContext::new(&temp_index, &rtxn)?;
389-
389+
390390
let nbr_typos = number_of_typos_allowed(&ctx)?;
391-
391+
392392
// ASCII word "doggy" (5 chars, 5 bytes)
393393
let ascii_word = "doggy";
394394
let ascii_typos = nbr_typos(ascii_word);
395-
396-
// Cyrillic word "собак" (5 chars, 10 bytes)
395+
396+
// Cyrillic word "собак" (5 chars, 10 bytes)
397397
let cyrillic_word = "собак";
398398
let cyrillic_typos = nbr_typos(cyrillic_word);
399-
399+
400400
// Both words have 5 characters, so they should have the same typo tolerance
401-
assert_eq!(ascii_typos, cyrillic_typos,
402-
"Words with same character count should get same typo tolerance");
403-
401+
assert_eq!(
402+
ascii_typos, cyrillic_typos,
403+
"Words with same character count should get same typo tolerance"
404+
);
405+
404406
// With default settings (oneTypo=5, twoTypos=9), 5-char words should get 1 typo
405407
assert_eq!(ascii_typos, 1, "5-character word should get 1 typo tolerance");
406408
assert_eq!(cyrillic_typos, 1, "5-character word should get 1 typo tolerance");
407-
409+
408410
Ok(())
409411
}
410412

411-
#[test]
413+
#[test]
412414
fn test_various_unicode_scripts() -> Result<()> {
413415
let temp_index = temp_index_with_documents();
414416
let rtxn = temp_index.read_txn()?;
415417
let ctx = SearchContext::new(&temp_index, &rtxn)?;
416-
418+
417419
let nbr_typos = number_of_typos_allowed(&ctx)?;
418-
420+
419421
// Let's use 5-character words for consistent testing
420422
let five_char_words = vec![
421-
("doggy", "ASCII"), // 5 chars, 5 bytes
422-
("café!", "Accented"), // 5 chars, 7 bytes
423-
("собак", "Cyrillic"), // 5 chars, 10 bytes
423+
("doggy", "ASCII"), // 5 chars, 5 bytes
424+
("café!", "Accented"), // 5 chars, 7 bytes
425+
("собак", "Cyrillic"), // 5 chars, 10 bytes
424426
];
425-
427+
426428
let expected_typos = 1; // With default settings, 5-char words get 1 typo
427-
429+
428430
for (word, script) in five_char_words {
429431
let typos = nbr_typos(word);
430-
assert_eq!(typos, expected_typos,
431-
"{} word '{}' should get {} typo(s)", script, word, expected_typos);
432+
assert_eq!(
433+
typos, expected_typos,
434+
"{} word '{}' should get {} typo(s)",
435+
script, word, expected_typos
436+
);
432437
}
433-
438+
434439
Ok(())
435440
}
436441
}

0 commit comments

Comments
 (0)