chore: add GitHub automation and fix rand vulnerability
GitHub Actions: - Add Dependabot for weekly dependency updates (cargo, github-actions) - Add PR labeler workflow with file-based auto-labeling - Add issue/PR templates (bug report, feature request, PR template) - Fix release.yml artifact paths and labeler.yml config syntax Security: - Upgrade rand 0.8 → 0.10 to fix RUSTSEC-2026-0097 unsoundness - Update screenshot.rs for rand 0.10 API (thread_rng → rng, gen_range → random_range)
This commit is contained in:
+3
-3
@@ -107,13 +107,13 @@ impl Screenshot {
|
||||
.with_data(|src| data.copy_from_slice(src))
|
||||
.unwrap();
|
||||
|
||||
use rand::Rng;
|
||||
let mut rng = rand::thread_rng();
|
||||
use rand::RngExt;
|
||||
let mut rng = rand::rng();
|
||||
|
||||
for x in 0..width {
|
||||
let mut melt_amount = 0.0;
|
||||
for y in 0..height {
|
||||
melt_amount += rng.gen_range(0.0..factor);
|
||||
melt_amount += rng.random_range(0.0..factor);
|
||||
let src_y = (y as f32 - melt_amount).max(0.0) as i32;
|
||||
|
||||
let src_idx = (src_y as usize * stride) + (x as usize * 4);
|
||||
|
||||
Reference in New Issue
Block a user