diff --git a/rust/lance-core/src/cache.rs b/rust/lance-core/src/cache.rs index dfd1f3003e..731473a062 100644 --- a/rust/lance-core/src/cache.rs +++ b/rust/lance-core/src/cache.rs @@ -124,9 +124,7 @@ impl FileMetadataCache { } pub fn get(&self, path: &Path) -> Option> { - let Some(cache) = self.cache.as_ref() else { - return None; - }; + let cache = self.cache.as_ref()?; let temp: Path; let path = if let Some(base_path) = &self.base_path { temp = base_path.child_path(path); diff --git a/rust/lance-encoding/src/decoder.rs b/rust/lance-encoding/src/decoder.rs index 29b5d904e3..4b34e89d9f 100644 --- a/rust/lance-encoding/src/decoder.rs +++ b/rust/lance-encoding/src/decoder.rs @@ -349,10 +349,7 @@ impl DecoderMiddlewareChain { /// Obtain a cursor into the chain that can be used to create /// field schedulers - pub(crate) fn cursor<'a>( - &'a self, - io: Arc, - ) -> DecoderMiddlewareChainCursor<'a> { + pub(crate) fn cursor(&self, io: Arc) -> DecoderMiddlewareChainCursor<'_> { DecoderMiddlewareChainCursor { chain: self, io, @@ -881,6 +878,7 @@ fn root_column(num_rows: u64) -> ColumnInfo { impl DecodeBatchScheduler { /// Creates a new decode scheduler with the expected schema and the column /// metadata of the file. + #[allow(clippy::too_many_arguments)] pub async fn try_new<'a>( schema: &'a Schema, column_indices: &[u32], @@ -898,7 +896,7 @@ impl DecodeBatchScheduler { let root_fields = arrow_schema.fields().clone(); let mut columns = Vec::with_capacity(column_infos.len() + 1); columns.push(Arc::new(root_column(num_rows))); - columns.extend(column_infos.iter().map(|col| col.clone())); + columns.extend(column_infos.iter().cloned()); let adjusted_column_indices = [0_u32] .into_iter() .chain(column_indices.iter().map(|i| *i + 1)) @@ -1305,8 +1303,8 @@ pub enum RequestedRows { impl RequestedRows { pub fn num_rows(&self) -> u64 { match self { - RequestedRows::Ranges(ranges) => ranges.iter().map(|r| r.end - r.start).sum(), - RequestedRows::Indices(indices) => indices.len() as u64, + Self::Ranges(ranges) => ranges.iter().map(|r| r.end - r.start).sum(), + Self::Indices(indices) => indices.len() as u64, } } } diff --git a/rust/lance-encoding/src/encodings/logical/list.rs b/rust/lance-encoding/src/encodings/logical/list.rs index c597cbc10a..97a3f51063 100644 --- a/rust/lance-encoding/src/encodings/logical/list.rs +++ b/rust/lance-encoding/src/encodings/logical/list.rs @@ -314,6 +314,7 @@ fn decode_offsets( /// /// This task does not wait for the items data. That happens on the main decode loop (unless /// we have list of list of ... in which case it happens in the outer indirect decode loop) +#[allow(clippy::too_many_arguments)] async fn indirect_schedule_task( mut offsets_decoder: Box, list_requests: Vec, diff --git a/rust/lance-file/src/v2/reader.rs b/rust/lance-file/src/v2/reader.rs index 173a92a6d9..6e15d9adf3 100644 --- a/rust/lance-file/src/v2/reader.rs +++ b/rust/lance-file/src/v2/reader.rs @@ -733,6 +733,7 @@ impl FileReader { ) } + #[allow(clippy::too_many_arguments)] fn do_take_rows( column_infos: Vec>, io: Arc, diff --git a/rust/lance/src/index/vector/ivf/v2.rs b/rust/lance/src/index/vector/ivf/v2.rs index 42859a6900..3038e92788 100644 --- a/rust/lance/src/index/vector/ivf/v2.rs +++ b/rust/lance/src/index/vector/ivf/v2.rs @@ -121,7 +121,7 @@ impl IVFIndex { let file_metadata_cache = session .upgrade() .map(|sess| sess.file_metadata_cache.clone()) - .unwrap_or_else(|| FileMetadataCache::no_cache()); + .unwrap_or_else(FileMetadataCache::no_cache); let index_reader = FileReader::try_open( scheduler .open_file(&index_dir.child(uuid.as_str()).child(INDEX_FILE_NAME))