version: Use fastrand v2.0.0
This commit is contained in:
parent
4a1e18daf9
commit
abb7a4e9ac
2 changed files with 5 additions and 2 deletions
|
|
@ -49,9 +49,12 @@ fn create_memfile() -> File {
|
|||
};
|
||||
use std::iter;
|
||||
|
||||
// Use a cached RNG to avoid hammering the thread local.
|
||||
let mut rng = fastrand::Rng::new();
|
||||
|
||||
for _ in 0..=4 {
|
||||
let mut name = String::from("softbuffer-");
|
||||
name.extend(iter::repeat_with(fastrand::alphanumeric).take(7));
|
||||
name.extend(iter::repeat_with(|| rng.alphanumeric()).take(7));
|
||||
name.push('\0');
|
||||
|
||||
let name = unsafe { CStr::from_bytes_with_nul_unchecked(name.as_bytes()) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue