From 9bd5ea4b4292761b0b2f823c887f114459c80d8f Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Mon, 27 Oct 2025 18:26:41 -0400 Subject: Convert the `Users` component into a freestanding struct. Because `Users` is test-only and is not used in any endpoints, it doesn't need a FromRef impl. --- src/user/app.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/user') diff --git a/src/user/app.rs b/src/user/app.rs index 0d6046c..891e3b9 100644 --- a/src/user/app.rs +++ b/src/user/app.rs @@ -3,13 +3,13 @@ use sqlx::sqlite::SqlitePool; use super::create::{self, Create}; use crate::{clock::DateTime, event::Broadcaster, login::Login, name::Name, password::Password}; -pub struct Users<'a> { - db: &'a SqlitePool, - events: &'a Broadcaster, +pub struct Users { + db: SqlitePool, + events: Broadcaster, } -impl<'a> Users<'a> { - pub const fn new(db: &'a SqlitePool, events: &'a Broadcaster) -> Self { +impl Users { + pub const fn new(db: SqlitePool, events: Broadcaster) -> Self { Self { db, events } } @@ -27,7 +27,7 @@ impl<'a> Users<'a> { tx.commit().await?; let login = stored.login().to_owned(); - stored.publish(self.events); + stored.publish(&self.events); Ok(login) } -- cgit v1.2.3