mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
clippy + fmt
This commit is contained in:
parent
b000ae7614
commit
834995b130
13 changed files with 78 additions and 53 deletions
|
@ -233,8 +233,8 @@ impl Index {
|
|||
fn compute_matches<A: AsRef<[u8]>>(
|
||||
matcher: &impl Matcher,
|
||||
document: &Document,
|
||||
analyzer: &Analyzer<A>
|
||||
) -> MatchesInfo {
|
||||
analyzer: &Analyzer<A>,
|
||||
) -> MatchesInfo {
|
||||
let mut matches = BTreeMap::new();
|
||||
|
||||
for (key, value) in document {
|
||||
|
@ -1174,6 +1174,9 @@ mod test {
|
|||
let analyzer = Analyzer::new(config);
|
||||
|
||||
let matches = compute_matches(&matcher, &value, &analyzer);
|
||||
assert_eq!(format!("{:?}", matches), r##"{"about": [MatchInfo { start: 0, length: 6 }, MatchInfo { start: 31, length: 7 }, MatchInfo { start: 191, length: 7 }, MatchInfo { start: 225, length: 7 }, MatchInfo { start: 233, length: 6 }], "color": [MatchInfo { start: 0, length: 3 }]}"##);
|
||||
assert_eq!(
|
||||
format!("{:?}", matches),
|
||||
r##"{"about": [MatchInfo { start: 0, length: 6 }, MatchInfo { start: 31, length: 7 }, MatchInfo { start: 191, length: 7 }, MatchInfo { start: 225, length: 7 }, MatchInfo { start: 233, length: 6 }], "color": [MatchInfo { start: 0, length: 3 }]}"##
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue