Update Rust crate rand to 0.9.0 #8
8
build.rs
8
build.rs
@@ -124,7 +124,7 @@ fn export_variables(tasks: Vec<Task>) {
|
|||||||
"#[allow(dead_code)]\nmod {} {{\n",
|
"#[allow(dead_code)]\nmod {} {{\n",
|
||||||
task.module_name
|
task.module_name
|
||||||
)) {
|
)) {
|
||||||
println!("{}", err);
|
println!("{err}");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -143,14 +143,14 @@ fn export_variables(tasks: Vec<Task>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for variable in variables {
|
for variable in variables {
|
||||||
if let Err(err) = dst_file.write_fmt(format_args!(" pub {}\n", variable)) {
|
if let Err(err) = dst_file.write_fmt(format_args!(" pub {variable}\n")) {
|
||||||
println!("{}", err);
|
println!("{err}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Err(err) = dst_file.write(b"}\n") {
|
if let Err(err) = dst_file.write(b"}\n") {
|
||||||
println!("{}", err);
|
println!("{err}");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@ use std::future::Future;
|
|||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
use std::{collections::HashMap, future::IntoFuture};
|
use std::{collections::HashMap, future::IntoFuture};
|
||||||
|
|
||||||
use rand::distributions::{Alphanumeric, DistString};
|
use rand::distr::{Alphanumeric, SampleString};
|
||||||
use reqwest::Result as RequestResult;
|
use reqwest::Result as RequestResult;
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ async fn fetch_dicebear_svg(
|
|||||||
// TODO: Use configuration file
|
// TODO: Use configuration file
|
||||||
let url = "dicebear.tools.adrien.run";
|
let url = "dicebear.tools.adrien.run";
|
||||||
|
|
||||||
let seed = Alphanumeric.sample_string(&mut rand::thread_rng(), 16);
|
let seed = Alphanumeric.sample_string(&mut rand::rng(), 16);
|
||||||
let type_str = r#type.to_string();
|
let type_str = r#type.to_string();
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"https://{url}/8.x/{type_str}/svg?seed={seed}&randomizeIds=true{}{}",
|
"https://{url}/8.x/{type_str}/svg?seed={seed}&randomizeIds=true{}{}",
|
||||||
|
Reference in New Issue
Block a user