Repository: qdrant/qdrant
File: lib/collection/src/config.rs (Rust)

Code before:
                                full_scan_threshold: params
                                    .index
                                    .and_then(|index| index.full_scan_threshold),
                                index_type: SparseIndexType::MutableRam,
                                datatype: params
                                    .index
                                    .and_then(|index| index.datatype)
                                    .map(VectorStorageDatatype::from),
                            },
                            storage_type: params.storage_type(),
                        },
                    ))
                })
                .collect()
        } else {
            Ok(Default::default())
        }
    }

    /// Convert into unoptimized segment config
    ///
    /// It is the job of the segment optimizer to change this configuration with optimized settings
    /// based on threshold configurations.
    pub fn to_base_segment_config(
        &self,
        collection_quantization: &Option<QuantizationConfig>,
    ) -> CollectionResult<SegmentConfig> {
        let vector_data = self.to_base_vector_data(collection_quantization).map_err(|err| {
            CollectionError::service_error(format!(
                "Failed to source dense vector configuration from collection parameters: {err:?}"
            ))
        })?;

        let sparse_vector_data = self.to_sparse_vector_data().map_err(|err| {
            CollectionError::service_error(format!(
                "Failed to source sparse vector configuration from collection parameters: {err:?}"
            ))
        })?;

        let payload_storage_type = self.payload_storage_type();

        let segment_config = SegmentConfig {
            vector_data,
            sparse_vector_data,
            payload_storage_type,
        };

        Ok(segment_config)
    }
}


Review comment (suggestion):
```suggestion
        collection_quantization: Option<&QuantizationConfig>,
```

Code after:
                                    .and_then(|index| index.full_scan_threshold),
                                index_type: SparseIndexType::MutableRam,
                                datatype: params
                                    .index
                                    .and_then(|index| index.datatype)
                                    .map(VectorStorageDatatype::from),
                            },
                            storage_type: params.storage_type(),
                        },
                    ))
                })
                .collect()
        } else {
            Ok(Default::default())
        }
    }

    /// Convert into unoptimized segment config
    ///
    /// It is the job of the segment optimizer to change this configuration with optimized settings
    /// based on threshold configurations.
    pub fn to_base_segment_config(
        &self,
        collection_quantization: Option<&QuantizationConfig>,
    ) -> CollectionResult<SegmentConfig> {
        let vector_data = self
            .to_base_vector_data(collection_quantization)
            .map_err(|err| {
                CollectionError::service_error(format!(
                    "Failed to source dense vector configuration from collection parameters: {err:?}"
                ))
            })?;

        let sparse_vector_data = self.to_sparse_vector_data().map_err(|err| {
            CollectionError::service_error(format!(
                "Failed to source sparse vector configuration from collection parameters: {err:?}"
            ))
        })?;

        let payload_storage_type = self.payload_storage_type();

        let segment_config = SegmentConfig {
            vector_data,
            sparse_vector_data,
            payload_storage_type,
        };

        Ok(segment_config)
    }
}