From c7c1144c67dc0d02245b31c5a6063f61f73f163f Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Thu, 26 Jan 2023 15:25:27 -0800 Subject: [PATCH] Update usage of uuid crate Bug: 229895468 Test: m rust Change-Id: I1d5b41a51637d2545f4ff037cac99f152dfdd392 --- libs/devicemapper/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/devicemapper/src/lib.rs b/libs/devicemapper/src/lib.rs index 4cf4e992..fec01141 100644 --- a/libs/devicemapper/src/lib.rs +++ b/libs/devicemapper/src/lib.rs @@ -227,8 +227,8 @@ fn uuid(node_id: &[u8]) -> Result { let context = Context::new(0); let now = SystemTime::now().duration_since(UNIX_EPOCH)?; let ts = Timestamp::from_unix(context, now.as_secs(), now.subsec_nanos()); - let uuid = Uuid::new_v1(ts, node_id)?; - Ok(String::from(uuid.to_hyphenated().encode_lower(&mut Uuid::encode_buffer()))) + let uuid = Uuid::new_v1(ts, node_id.try_into()?); + Ok(String::from(uuid.hyphenated().encode_lower(&mut Uuid::encode_buffer()))) } #[cfg(test)]