mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
tests: update random_chars generator to map u8 to char
Fix 'value of type `char` cannot be built from `std::iter::Iterator<Item=u8>`' for split test. refs: https://docs.rs/rand/0.8.4/rand/distributions/struct.Alphanumeric.html#example
This commit is contained in:
parent
cae6bc5e82
commit
771c9f5d9c
1 changed files with 1 additions and 0 deletions
|
@ -22,6 +22,7 @@ use std::{
|
|||
fn random_chars(n: usize) -> String {
|
||||
thread_rng()
|
||||
.sample_iter(&rand::distributions::Alphanumeric)
|
||||
.map(char::from)
|
||||
.take(n)
|
||||
.collect::<String>()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue