Crates.io | vec_rand |
lib.rs | vec_rand |
version | 0.1.2 |
source | src |
created_at | 2021-11-21 10:16:40.959951 |
updated_at | 2022-01-06 15:50:49.937756 |
description | Vec generator to hold random contents. |
homepage | |
repository | |
max_upload_size | |
id | 485235 |
size | 1,949 |
Add this to your Cargo.toml:
[dependencies]
vec_rand = "0.1.0"
let len = 10;
// Pass the type you want to generate to Generics.
// RandVec::generate<i32>(len);
let v = RandVec::generate<u8>(len);
println!(":?", v);
// [107, 58, 138, 135, 112, 216, 235, 226, 68, 104]