From 9aaf8d2c82345bf73b98365a16b5738125dcdb26 Mon Sep 17 00:00:00 2001 From: Dawid Pawlik Date: Tue, 21 Jul 2026 14:04:36 +0200 Subject: [PATCH] cuvs: add package version retrieval function Add a function that allows to retrieve the current version of a `cuvs` package. Also add a simple unit test for the function. --- rust/cuvs/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/cuvs/src/lib.rs b/rust/cuvs/src/lib.rs index 52c31392e7..4f5caae02e 100644 --- a/rust/cuvs/src/lib.rs +++ b/rust/cuvs/src/lib.rs @@ -26,3 +26,18 @@ pub mod vamana; pub use dlpack::{AsDlTensor, AsDlTensorMut, DLPackError, DLTensorView, DLTensorViewMut, DType}; pub use error::{Error, Result}; pub use resources::Resources; + +/// Returns the version of this `cuvs` crate. +pub fn version() -> &'static str { + env!("CARGO_PKG_VERSION") +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_version() { + assert_eq!(version(), env!("CARGO_PKG_VERSION")); + } +}