From 49ba8f8b1b3e1183f23c2d463775c0995f88ec7f Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Mon, 3 Oct 2022 18:50:46 -0700 Subject: [PATCH] Zero-pad the random number suffix of TempPathBufs. This way, the hex number is always 16 digits, which is helpful for test verification as well as simple consistency. --- tarpc/src/serde_transport.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarpc/src/serde_transport.rs b/tarpc/src/serde_transport.rs index 55eb8d9..5f9dcd5 100644 --- a/tarpc/src/serde_transport.rs +++ b/tarpc/src/serde_transport.rs @@ -443,7 +443,7 @@ pub mod unix { /// Appends a random hex string to the socket name resulting in /// `/_` pub fn with_random>(name: S) -> Self { - Self::new(format!("{}_{:x}", name.as_ref(), rand::random::())) + Self::new(format!("{}_{:016x}", name.as_ref(), rand::random::())) } }