1
Fork 0
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:
Greg Guthe 2022-01-17 20:23:51 -05:00
parent cae6bc5e82
commit 771c9f5d9c

View file

@ -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>()
}