From be21b088f0d1b591cbd8dcfed1e06f2742a524d0 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Mon, 27 Oct 2025 18:23:34 -0400 Subject: Convert the `Tokens` component into a freestanding struct. As with the `Setup` component, I've generalized the associated middleware across anything that can provide a `Tokens`, where possible. --- src/app.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 202d542..6f6e8ba 100644 --- a/src/app.rs +++ b/src/app.rs @@ -62,8 +62,8 @@ impl App { Setup::new(self.db.clone(), self.events.clone()) } - pub const fn tokens(&self) -> Tokens<'_> { - Tokens::new(&self.db, &self.token_events) + pub fn tokens(&self) -> Tokens { + Tokens::new(self.db.clone(), self.token_events.clone()) } #[cfg(test)] @@ -107,3 +107,9 @@ impl FromRef for Setup { app.setup() } } + +impl FromRef for Tokens { + fn from_ref(app: &App) -> Self { + app.tokens() + } +} -- cgit v1.2.3