mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-21 18:15:29 +08:00
17 lines
344 B
Rust
17 lines
344 B
Rust
|
use std::cmp::Ordering;
|
||
|
use crate::criterion::Criterion;
|
||
|
use crate::RawDocument;
|
||
|
|
||
|
#[derive(Debug, Clone, Copy)]
|
||
|
pub struct DocumentId;
|
||
|
|
||
|
impl Criterion for DocumentId {
|
||
|
fn evaluate(&self, lhs: &RawDocument, rhs: &RawDocument) -> Ordering {
|
||
|
lhs.id.cmp(&rhs.id)
|
||
|
}
|
||
|
|
||
|
fn name(&self) -> &'static str {
|
||
|
"DocumentId"
|
||
|
}
|
||
|
}
|