mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-20 02:05:58 +01:00
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.
This commit is contained in:
@@ -443,7 +443,7 @@ pub mod unix {
|
||||
/// Appends a random hex string to the socket name resulting in
|
||||
/// `<tempdir>/<name>_<xxxxx>`
|
||||
pub fn with_random<S: AsRef<str>>(name: S) -> Self {
|
||||
Self::new(format!("{}_{:x}", name.as_ref(), rand::random::<u64>()))
|
||||
Self::new(format!("{}_{:016x}", name.as_ref(), rand::random::<u64>()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user