diff --git a/common/src/file_slice.rs b/common/src/file_slice.rs index dbaec16ac..9f6259ae4 100644 --- a/common/src/file_slice.rs +++ b/common/src/file_slice.rs @@ -121,7 +121,7 @@ pub struct FileSlice { impl fmt::Debug for FileSlice { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "FileSlice({:?}, {:?})", &self.data, self.range) + write!(f, "FileSlice({:?}, {:?})", self.data, self.range) } } diff --git a/src/collector/sort_key/sort_by_static_fast_value.rs b/src/collector/sort_key/sort_by_static_fast_value.rs index 44a4e1d8d..d99c00842 100644 --- a/src/collector/sort_key/sort_by_static_fast_value.rs +++ b/src/collector/sort_key/sort_by_static_fast_value.rs @@ -52,7 +52,7 @@ impl SortKeyComputer for SortByStaticFastValue { if schema_type != T::to_type() { return Err(crate::TantivyError::SchemaError(format!( "Field `{}` is of type {schema_type:?}, not of the type {:?}.", - &self.field, + self.field, T::to_type() ))); } diff --git a/src/index/segment_reader.rs b/src/index/segment_reader.rs index c1ed4288f..cfb177064 100644 --- a/src/index/segment_reader.rs +++ b/src/index/segment_reader.rs @@ -322,7 +322,7 @@ impl SegmentReader { // Without expand dots enabled dots need to be escaped. let escaped_json_path = json_path.replace('.', "\\."); let full_path = format!("{field_name}.{escaped_json_path}"); - let full_path_unescaped = format!("{}.{}", field_name, &json_path); + let full_path_unescaped = format!("{}.{}", field_name, json_path); map_to_canonical.insert(full_path_unescaped, full_path.to_string()); full_path } else { diff --git a/src/store/index/skip_index.rs b/src/store/index/skip_index.rs index 46b30dae1..02036d263 100644 --- a/src/store/index/skip_index.rs +++ b/src/store/index/skip_index.rs @@ -94,13 +94,7 @@ impl SkipIndex { byte_range: 0..first_layer_len, }; for layer in &self.layers { - if let Some(checkpoint) = - layer.seek_start_at_offset(target, cur_checkpoint.byte_range.start) - { - cur_checkpoint = checkpoint; - } else { - return None; - } + cur_checkpoint = layer.seek_start_at_offset(target, cur_checkpoint.byte_range.start)?; } Some(cur_checkpoint) }