From ec4483ae5d8b1f5df7ca6794344379449b807e71 Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Sun, 15 Dec 2024 23:14:21 +0300 Subject: [PATCH] type signatures --- src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index f671d93..e531ed3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,7 +75,7 @@ async fn main() -> eyre::Result<()> { reg.register_helper("duration", Box::new(helpers::duration)); debug!(duration = ?start.elapsed(), "registered all templates"); - let reg = Arc::new(RwLock::new(reg)); + let registry = Arc::new(RwLock::new(reg)); debug!("setting up watcher"); let watcher_token = cancellation_token.child_token(); @@ -83,7 +83,7 @@ async fn main() -> eyre::Result<()> { watch_templates( config.dirs.custom_templates.clone(), watcher_token.clone(), - reg.clone(), + registry.clone(), ) .instrument(info_span!("custom_template_watcher")), ); @@ -112,7 +112,8 @@ async fn main() -> eyre::Result<()> { .map(|cache| CacheGuard::new(cache, config.cache.clone())) .map(Arc::new); - let posts = Arc::new(MarkdownPosts::new(Arc::clone(&config), cache.clone()).await?); + let posts: Arc = + Arc::new(MarkdownPosts::new(Arc::clone(&config), cache.clone()).await?); if config.cache.enable && config.cache.cleanup { if let Some(millis) = config.cache.cleanup_interval { @@ -137,8 +138,8 @@ async fn main() -> eyre::Result<()> { let state = AppState { config: Arc::clone(&config), - posts: posts as Arc, - templates: Arc::clone(®), + posts, + templates: registry, }; let app = app::new(&config).with_state(state.clone());