From 9b97327460ce4875da80e4f5c40da942e1dab5b6 Mon Sep 17 00:00:00 2001 From: Francesco Date: Thu, 25 Jan 2024 23:33:42 +0100 Subject: [PATCH] actions --- .github/workflows/rust.yml | 4 +++- search/src/query/document_selector.rs | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 28bfe70..b1a8444 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,7 +17,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Fmt - run: cargo fmt --check + run: cargo fmt --verbose + - name: Clippy + run: cargo clippy --verbose - name: Build run: cargo build --verbose - name: Run tests diff --git a/search/src/query/document_selector.rs b/search/src/query/document_selector.rs index 2b55f0e..d5df92b 100644 --- a/search/src/query/document_selector.rs +++ b/search/src/query/document_selector.rs @@ -16,13 +16,16 @@ impl Eq for Entry {} impl PartialOrd for Entry { fn partial_cmp(&self, other: &Self) -> Option { - other.score.partial_cmp(&self.score) + Some(self.cmp(other)) } } impl Ord for Entry { fn cmp(&self, other: &Self) -> Ordering { - other.partial_cmp(self).unwrap() + other + .score + .partial_cmp(&self.score) + .unwrap_or(Ordering::Equal) } }