Update password generator to new Rand API

Replace `thread_rng` with `rng` and use `random_range` for character
selection. Rename the `component` argument to `_component` in
`PackageManager::download_binary` to suppress an unused‑parameter
warning.
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-10-18 22:26:42 -03:00
parent d970d48aa7
commit e1f9111392
2 changed files with 3 additions and 3 deletions

View file

@ -424,10 +424,10 @@ impl BootstrapManager {
fn generate_password(&self) -> String { fn generate_password(&self) -> String {
use rand::Rng; use rand::Rng;
const CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; const CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let mut rng = rand::thread_rng(); let mut rng = rand::rng();
(0..16) (0..16)
.map(|_| { .map(|_| {
let idx = rng.gen_range(0..CHARSET.len()); let idx = rng.random_range(0..CHARSET.len());
CHARSET[idx] as char CHARSET[idx] as char
}) })
.collect() .collect()

View file

@ -1164,7 +1164,7 @@ impl PackageManager {
&self, &self,
container: &str, container: &str,
url: &str, url: &str,
component: &str, _component: &str,
binary_name: Option<&str>, binary_name: Option<&str>,
) -> Result<()> { ) -> Result<()> {
let download_cmd = format!("wget -O /tmp/download.tmp {}", url); let download_cmd = format!("wget -O /tmp/download.tmp {}", url);