simple-web-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 54df83be67cd35880ed62541dace5b4ae3568ac8
parent 91b0e076f22bbcd74c2624224384a916b9356ef3
Author: Silas Brack <silasbrack@gmail.com>
Date:   Fri, 12 Jun 2026 22:17:37 +0200

chore: remove unused deps (serde_json, uuid)

serde_json had zero uses (leftover from TrailBase).
uuid replaced with rand hex string (rand already a dep).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
MCargo.lock | 2--
MCargo.toml | 4+---
Msrc/handlers/auth.rs | 12++++++++++--
3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -1482,12 +1482,10 @@ dependencies = [ "rand 0.8.6", "rusqlite", "serde", - "serde_json", "thiserror", "tokio", "tokio-stream", "tracing", - "uuid", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml @@ -9,9 +9,8 @@ axum-extra = { version = "0.10", features = ["cookie"] } askama = "0.12" chrono = { version = "0.4", features = ["serde"] } tokio = { version = "1", features = ["macros", "rt-multi-thread", "net"] } -tokio-stream = { version = "0.1", features = ["sync"] } serde = { version = "1", features = ["derive"] } -serde_json = "1" +tokio-stream = { version = "0.1", features = ["sync"] } thiserror = "2" tracing = "0.1" rusqlite = "0.31" @@ -21,4 +20,3 @@ argon2 = "0.5" jsonwebtoken = "9" rand = "0.8" lettre = { version = "0.11", features = ["smtp-transport", "builder"] } -uuid = { version = "1", features = ["v4"] } diff --git a/src/handlers/auth.rs b/src/handlers/auth.rs @@ -161,7 +161,11 @@ pub async fn register( let username = form.username.clone(); let email = form.email.clone(); let password = form.password.clone(); - let token = uuid::Uuid::new_v4().to_string(); + let token = { + use rand::Rng; + let bytes: [u8; 16] = rand::thread_rng().gen(); + bytes.iter().map(|b| format!("{:02x}", b)).collect::<String>() + }; let token_clone = token.clone(); let result = state.db_query(move |db| { @@ -263,7 +267,11 @@ pub async fn resend_verification( Form(form): Form<ResendVerificationForm>, ) -> Result<Html<String>, AppError> { let email = form.email.clone(); - let new_token = uuid::Uuid::new_v4().to_string(); + let new_token = { + use rand::Rng; + let bytes: [u8; 16] = rand::thread_rng().gen(); + bytes.iter().map(|b| format!("{:02x}", b)).collect::<String>() + }; let new_token_clone = new_token.clone(); let user_found = state.db_query(move |db| {