NOBUG expose a version public api. Handy to check if the compilation was made with simd or not.

This commit is contained in:
Paul Masurel
2017-01-11 21:06:41 +09:00
parent c0049e8487
commit 3b69e790e9
2 changed files with 12 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ lz4 = "1.13"
time = "0.1"
uuid = "0.1"
chan = "0.1"
version = "2"
crossbeam = "0.2"
[dev-dependencies]

View File

@@ -26,6 +26,9 @@ extern crate lazy_static;
#[macro_use]
extern crate log;
#[macro_use]
extern crate version;
#[macro_use]
extern crate fst;
extern crate byteorder;
@@ -111,7 +114,15 @@ pub use postings::DocSet;
pub use postings::Postings;
pub use postings::SegmentPostingsOption;
#[cfg(feature="simdcompression")]
pub fn version() -> &'static str {
concat!(version!(), "-simd")
}
#[cfg(not(feature="simdcompression"))]
pub fn version() -> &'static str {
concat!(version!(), "-nosimd")
}
/// Tantivy's makes it possible to personalize when
/// the indexer should merge its segments