From 16890eaa45d2838f99d18fa9be90acc1d20f2899 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 26 Feb 2024 15:58:06 -0600 Subject: [PATCH] Just keep timestamp component of v7 for directory --- src/file_path.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/file_path.rs b/src/file_path.rs index 2b03937..2be6611 100644 --- a/src/file_path.rs +++ b/src/file_path.rs @@ -12,13 +12,7 @@ pub(crate) fn generate_object() -> String { } fn generate() -> Vec { - Uuid::now_v7() - .into_bytes() - .into_iter() - .map(to_hex) - .collect() -} + let s = Uuid::now_v7().simple().to_string(); -fn to_hex(byte: u8) -> String { - format!("{byte:x}") + (0..6).map(|i| s[i * 2..i * 2 + 2].to_string()).collect() }