Repository: qdrant/qdrant
File: lib/segment/src/segment/snapshot.rs (Rust)

Code before:
    }
}

impl Segment {
    pub fn segment_id(&self) -> OperationResult<&str> {
        let id = self
            .current_path
            .file_stem()
            .and_then(|segment_dir| segment_dir.to_str())
            .ok_or_else(|| {
                OperationError::service_error(format!(
                    "failed to extract segment ID from segment path {}",
                    self.current_path.display(),
                ))
            })?;

        debug_assert!(
            Uuid::try_parse(id).is_ok(),
            "segment ID {id} is not a valid UUID",
        );

        Ok(id)
    }

    fn get_segment_manifest(&self) -> OperationResult<SegmentManifest> {
        let segment_id = self.segment_id()?; //
        let segment_version = self.version();

        let files = self
            .files()
            .into_iter()
            .map(|path| (path, FileVersion::Unversioned));

        let vector_storage_files =
            self.vector_data
                .iter()
                .flat_map(|(vector_name, vector_data)| {
                    let version = self.version_tracker.get_vector(vector_name);

                    vector_data
                        .vector_storage
                        .borrow()
                        .files()
                        .into_iter()
                        .map(move |file| (file, FileVersion::from(version)))
                });

        let payload_storage_files = self
            .payload_storage
            .borrow()
            .files()

Review comment (suggestion):
```suggestion
        let segment_id = self.segment_id()?;
```

Code after:
                    let tar = tar.descend(Path::new(SNAPSHOT_PATH))?;
                    snapshot_files(self, temp_path, &tar, include_if)
                })??;
            }
            SnapshotFormat::Streamable => {
                let tar = tar.descend(Path::new(&segment_id))?;
                snapshot_files(self, temp_path, &tar, include_if)?;
            }
        }

        Ok(())
    }

    fn get_segment_manifest(&self) -> OperationResult<SegmentManifest> {
        self._get_segment_manifest()
    }
}

impl Segment {
    fn _get_segment_manifest(&self) -> OperationResult<SegmentManifest> {
        let segment_id = self.segment_id()?;
        let segment_version = self.version();

        let files = self
            .files()
            .into_iter()
            .map(|path| (path, FileVersion::Unversioned));

        let vector_storage_files =
            self.vector_data
                .iter()
                .flat_map(|(vector_name, vector_data)| {
                    let version = self.version_tracker.get_vector(vector_name);

                    vector_data
                        .vector_storage
                        .borrow()
                        .files()
                        .into_iter()
                        .map(move |file| (file, FileVersion::from(version)))
                });

        let payload_storage_files = self
            .payload_storage
            .borrow()
            .files()
            .into_iter()
            .map(|file| (file, FileVersion::from(self.version_tracker.get_payload())));

        let payload_index_files = self
            .payload_index