mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-06-01 10:28:02 +02: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"
|
|
}
|
|
}
|