From 4d6d8974e4ece0398188f71fce8aaf38629d8f45 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Mon, 11 Aug 2025 19:01:08 +0100 Subject: [PATCH] fix: feature gating for `blog` breaking other builds --- src/components/content.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/content.rs b/src/components/content.rs index 3b43346..ae3f341 100644 --- a/src/components/content.rs +++ b/src/components/content.rs @@ -9,7 +9,7 @@ use ratatui::{prelude::*, widgets::*}; use tokio::sync::mpsc::UnboundedSender; use super::Component; -use crate::{action::Action, atproto, config::Config}; +use crate::{action::Action, config::Config}; #[derive(Default)] pub struct Content { @@ -178,7 +178,7 @@ impl Content { /// Generate the content for the "Blog" tab #[cfg(feature = "blog")] async fn blog_content(&self) -> Result>> { - Ok(atproto::blog::get_all_posts() + Ok(crate::atproto::blog::get_all_posts() .await? .iter() .map(|post| Line::from(post.title.clone().unwrap_or("".to_string()))) @@ -211,14 +211,16 @@ impl Component for Content { 0 => self.about_content(area)?, 1 => self.projects_content(), 2 => { - if cfg!(feature = "blog") { + #[cfg(feature = "blog")] + { let rt = tokio::runtime::Handle::current(); rt.block_on(self.blog_content())? - } else { - vec![Line::from( - "Blog feature is disabled. Enable the `blog` feature to view this tab.", - )] } + + #[cfg(not(feature = "blog"))] + vec![Line::from( + "Blog feature is disabled. Enable the `blog` feature to view this tab.", + )] } _ => unreachable!(), };