chore: update dependencies

This commit is contained in:
neri 2025-03-24 18:36:29 +01:00
parent 273451f8d4
commit 5cf12b595f
4 changed files with 373 additions and 274 deletions

635
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "datatrash"
version = "2.5.2"
version = "2.5.3"
authors = ["neri"]
edition = "2021"
@ -25,7 +25,7 @@ actix-files = "0.6.2"
tokio = { version = "1.25.0", features = ["rt-multi-thread", "macros", "sync"] }
actix-multipart = "0.7.0"
futures-util = "0.3.26"
rand = "0.8.5"
rand = "0.9.0"
time = "0.3.17"
htmlescape = "0.3.1"
urlencoding = "2.1.2"

View file

@ -20,7 +20,7 @@ pub async fn insert_script_nonce(
req: ServiceRequest,
next: Next<impl MessageBody>,
) -> Result<ServiceResponse<impl MessageBody>, Error> {
let script_nonce = format!("{:02x}", rand::thread_rng().gen::<u128>());
let script_nonce = format!("{:02x}", rand::rng().random::<u128>());
req.extensions_mut()
.insert(ScriptNonce(script_nonce.clone()));
let mut res = next.call(req).await;

View file

@ -6,7 +6,7 @@ use crate::{file_info, multipart, template};
use actix_multipart::Multipart;
use actix_web::http::header::LOCATION;
use actix_web::{error, web, Error, HttpRequest, HttpResponse};
use rand::{distributions::Slice, Rng};
use rand::{distr::slice::Choose, Rng};
use sqlx::postgres::PgPool;
use std::path::{Path, PathBuf};
use tokio::fs::{self, OpenOptions};
@ -94,8 +94,8 @@ async fn create_unique_file_id(
}
fn gen_file_id() -> String {
let distribution = Slice::new(ID_CHARS).expect("ID_CHARS is not empty");
rand::thread_rng()
let distribution = Choose::new(ID_CHARS).expect("ID_CHARS is not empty");
rand::rng()
.sample_iter(distribution)
.take(5)
.collect()