Absolucy / Absolucy/nanorand-rs
How does/does fill() work at all ?
- Ngôn ngữ chính
- Rust
- Star
- 251
- Fork
- 24
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I was trying to generate some uuids and it seems that fill() just takes mutable references to temporary copies of the bytes in an array. I have to map the initial zeroed array and just use generate() to get it to work.
```rust
let mut rng = nanorand::tls_rng();
let random_bytes = [0; 16];
let random_bytes = random_bytes.map(|_| rng.generate::());
```
the above works
```rust
rng.fill(random_bytes);
rng.fill_bytes(random_bytes);
```
the above two do nothing, regardless of the declared mutability of `random_bytes`
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.