From 172055c48048289ff8b25ca8f439864b351342a9 Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Mon, 7 Jul 2025 12:53:05 -0600 Subject: [PATCH] always render issue UUIDs as 128 bit hex numbers --- src/git.rs | 4 ++-- src/issue.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/git.rs b/src/git.rs index bb17763..caa5e4b 100644 --- a/src/git.rs +++ b/src/git.rs @@ -213,7 +213,7 @@ mod tests { fn test_create_orphan_branch() { let rnd: u128 = rand::random(); let mut branch = std::string::String::from("entomologist-test-branch-"); - branch.push_str(&format!("{:0x}", rnd)); + branch.push_str(&format!("{:032x}", rnd)); create_orphan_branch(&branch).unwrap(); git_remove_branch(&branch).unwrap(); } @@ -228,7 +228,7 @@ mod tests { fn test_branch_exists_1() { let rnd: u128 = rand::random(); let mut branch = std::string::String::from("entomologist-missing-branch-"); - branch.push_str(&format!("{:0x}", rnd)); + branch.push_str(&format!("{:032x}", rnd)); let r = git_branch_exists(&branch).unwrap(); assert_eq!(r, false); } diff --git a/src/issue.rs b/src/issue.rs index 8031300..bb8594a 100644 --- a/src/issue.rs +++ b/src/issue.rs @@ -107,7 +107,7 @@ impl Issue { pub fn new(dir: &std::path::Path) -> Result { let mut issue_dir = std::path::PathBuf::from(dir); let rnd: u128 = rand::random(); - issue_dir.push(&format!("{:0x}", rnd)); + issue_dir.push(&format!("{:032x}", rnd)); std::fs::create_dir(&issue_dir)?; Ok(Self { description: String::from(""), // FIXME: kind of bogus to use the empty string as None