mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-03-13 20:31:17 +08:00
17 lines
336 B
Rust
17 lines
336 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) -> &str {
|
|
"DocumentId"
|
|
}
|
|
}
|