diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-10-27 17:33:30 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-10-28 01:27:13 -0400 |
| commit | 6de7402a002791c6216b12a40e74af9c8ab82c02 (patch) | |
| tree | ab937f60b96fc18933d43377b951755cb833c781 | |
| parent | 398bc79a3f1f4316e6cc33b6e6bce133c1db3e4c (diff) | |
Convert the `Events` app component into a freestanding struct.
This one doesn't need a FromRef impl at this time, as it's only ever used in a handler that also uses other components and so will need to continue receiving `App`. However, there's little reason not to make the implementatino of the `Events` struct consistent.
| -rw-r--r-- | src/app.rs | 4 | ||||
| -rw-r--r-- | src/event/app.rs | 10 |
2 files changed, 7 insertions, 7 deletions
@@ -42,8 +42,8 @@ impl App { Conversations::new(self.db.clone(), self.events.clone()) } - pub const fn events(&self) -> Events<'_> { - Events::new(&self.db, &self.events) + pub fn events(&self) -> Events { + Events::new(self.db.clone(), self.events.clone()) } pub const fn invites(&self) -> Invites<'_> { diff --git a/src/event/app.rs b/src/event/app.rs index 7359bfb..8fa760a 100644 --- a/src/event/app.rs +++ b/src/event/app.rs @@ -13,13 +13,13 @@ use crate::{ user::{self, repo::Provider as _}, }; -pub struct Events<'a> { - db: &'a SqlitePool, - events: &'a Broadcaster, +pub struct Events { + db: SqlitePool, + events: Broadcaster, } -impl<'a> Events<'a> { - pub const fn new(db: &'a SqlitePool, events: &'a Broadcaster) -> Self { +impl Events { + pub const fn new(db: SqlitePool, events: Broadcaster) -> Self { Self { db, events } } |
