use log::error; use rand::distributions::Alphanumeric; use rand::{thread_rng, Rng}; pub fn log_err(e: sqlx::Error) -> sqlx::Error { error!("{:?}", e); e } pub fn generate_random_url_safe(n: usize) -> String { thread_rng() .sample_iter(&Alphanumeric) .take(n) .map(char::from) .collect() }