diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-10-27 18:23:34 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-10-28 02:08:11 -0400 |
| commit | be21b088f0d1b591cbd8dcfed1e06f2742a524d0 (patch) | |
| tree | 7b4b006d485c921def8d1f4605257763d218feb6 /src/app.rs | |
| parent | d66728889105f6f1ef5113d9ceb223e362df0008 (diff) | |
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.
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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<App> for Setup { app.setup() } } + +impl FromRef<App> for Tokens { + fn from_ref(app: &App) -> Self { + app.tokens() + } +} |
