[tantivy] Run clippy linter (#914)

This commit is contained in:
Pasha Podolsky
2020-10-27 08:36:02 +03:00
committed by GitHub
parent 2eb5326aa4
commit 71c66a5405
3 changed files with 9 additions and 5 deletions

View File

@@ -143,7 +143,7 @@ impl MultiValueIntFastFieldWriter {
.iter()
.map(|val| *mapping.get(val).expect("Missing term ordinal"));
doc_vals.extend(remapped_vals);
doc_vals.sort();
doc_vals.sort_unstable();
for &val in &doc_vals {
value_serializer.add_val(val)?;
}

View File

@@ -450,9 +450,8 @@ impl SegmentUpdater {
.into_iter()
.map(|merge_candidate: MergeCandidate| {
MergeOperation::new(&self.merge_operations, commit_opstamp, merge_candidate.0)
})
.collect::<Vec<_>>();
merge_candidates.extend(committed_merge_candidates.into_iter());
});
merge_candidates.extend(committed_merge_candidates);
for merge_operation in merge_candidates {
if let Err(err) = self.start_merge(merge_operation) {

View File

@@ -7,7 +7,7 @@ use std::{cmp::Ordering, fmt};
/// Value represents the value of a any field.
/// It is an enum over all over all of the possible field type.
#[derive(Debug, Clone, PartialEq, PartialOrd)]
#[derive(Debug, Clone, PartialEq)]
pub enum Value {
/// The str type is used for any text information.
Str(String),
@@ -28,6 +28,11 @@ pub enum Value {
}
impl Eq for Value {}
impl PartialOrd for Value {
fn partial_cmp(&self, other: &Value) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for Value {
fn cmp(&self, other: &Self) -> Ordering {
match (self, other) {