Skip to content

Commit 697744d

Browse files
committed
fix: address PR review feedback
- update qlty-check/src/utils.rs - address 2 review comment(s) Signed-off-by: Zendy <50132805+zendy199x@users.noreply.github.com>
1 parent fc164df commit 697744d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qlty-check/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
use getrandom::getrandom;
1+
use rand::rngs::OsRng;
22

33
pub fn generate_random_id(length: usize) -> String {
44
// Use a URL/filename-safe alphabet to avoid control chars, path separators, etc.
55
const ALPHABET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\nabcdefghijklmnopqrstuvwxyz\n0123456789-_";
66

77
let mut buf = vec![0u8; length];
8-
getrandom(&mut buf).expect("Failed to generate random ID");
8+
getrandom(&mut buf)?;
99

1010
let mut id = String::with_capacity(length);
1111
for byte in buf {

0 commit comments

Comments
 (0)