From ae83fc82982c43a0848c247b774b4e96183c9dde Mon Sep 17 00:00:00 2001 From: PSeitz Date: Fri, 22 Apr 2022 03:02:24 +0200 Subject: [PATCH] bump uuid to 1.0 (#1345) --- Cargo.toml | 2 +- src/core/segment_id.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c78da8423e..85d309fb12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ serde_json = "1.0.64" num_cpus = "1.13" fs2={ version = "0.4.3", optional = true } levenshtein_automata = "0.2" -uuid = { version = "0.8.2", features = ["v4", "serde"] } +uuid = { version = "1.0.0", features = ["v4", "serde"] } crossbeam = "0.8.1" tantivy-query-grammar = { version="0.15.0", path="./query-grammar" } tantivy-bitpacker = { version="0.1", path="./bitpacker" } diff --git a/src/core/segment_id.rs b/src/core/segment_id.rs index eb5bec5f6c..5fd3336b65 100644 --- a/src/core/segment_id.rs +++ b/src/core/segment_id.rs @@ -35,7 +35,7 @@ const ZERO_ARRAY: [u8; 8] = [0u8; 8]; #[cfg(test)] fn create_uuid() -> Uuid { let new_auto_inc_id = (*AUTO_INC_COUNTER).fetch_add(1, atomic::Ordering::SeqCst); - Uuid::from_fields(new_auto_inc_id as u32, 0, 0, &ZERO_ARRAY).unwrap() + Uuid::from_fields(new_auto_inc_id as u32, 0, 0, &ZERO_ARRAY) } #[cfg(not(test))] @@ -57,7 +57,7 @@ impl SegmentId { /// Picking the first 8 chars is ok to identify /// segments in a display message (e.g. a5c4dfcb). pub fn short_uuid_string(&self) -> String { - (&self.0.to_simple_ref().to_string()[..8]).to_string() + (&self.0.as_simple().to_string()[..8]).to_string() } /// Returns a segment uuid string. @@ -65,7 +65,7 @@ impl SegmentId { /// It consists in 32 lowercase hexadecimal chars /// (e.g. a5c4dfcbdfe645089129e308e26d5523) pub fn uuid_string(&self) -> String { - self.0.to_simple_ref().to_string() + self.0.as_simple().to_string() } /// Build a `SegmentId` string from the full uuid string.