diff --git a/src/main.rs b/src/main.rs index 12688de..8a833b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -346,7 +346,6 @@ fn main_debug_rss(cli: CliDebugRss) -> Result<()> { println!("{}", item.channel_title); println!("{}", item.inner.title.as_ref().unwrap()); println!("{}", item.date.to_rfc3339()); - println!("{}", item.inner.link.as_ref().unwrap()); println!(); } diff --git a/src/output.rs b/src/output.rs index 61fb772..b7dd4f6 100644 --- a/src/output.rs +++ b/src/output.rs @@ -58,14 +58,6 @@ impl Config { } } -fn day_link(date: chrono::NaiveDate) -> maud::PreEscaped { - let date_s = date.format("%-d %A"); - let id = date.format("%F"); - maud::html! { - h3 id=(id) { (date_s) " " a href=(format!("#{id}")) title=(format!("Permalink to {date_s}")) {"🔗"} } - } -} - fn calendar_link(calendar_ui: &crate::CalendarUi) -> maud::PreEscaped { if let Some(html_url) = &calendar_ui.html_url { maud::html! { a href=(html_url) { (calendar_ui.short_name) } } @@ -118,7 +110,7 @@ fn calendars_page(upstreams: &[crate::CalendarUi], now: DateTime) .into_string() } -pub(crate) fn feed_page(_feed_items: &[crate::FeedItem], _now: DateTime) -> String { +pub(crate) fn feed_page(feed_items: &[crate::FeedItem], now: DateTime) -> String { todo!() } @@ -170,8 +162,10 @@ fn index_page( p class="past"{ s { (date.format("%-d %A")) } } }); } else { + let date_s = date.format("%-d %A"); + let id = date.format("%F"); html_list.push(maud::html! { - (day_link(date)) + h3 id=(id) { (date_s) " " a href=(format!("#{id}")) title=(format!("Permalink to {date_s}")) {"🔗"} } hr{} }); } diff --git a/src/wac_campfire.rs b/src/wac_campfire.rs index 8388812..8520b21 100644 --- a/src/wac_campfire.rs +++ b/src/wac_campfire.rs @@ -27,8 +27,7 @@ struct Event { _end_time: Option, #[serde(alias = "eventName")] event_name: String, - // Seen in test data where this can be missing - location: Option, + location: String, #[serde(alias = "Id")] id: String, #[serde(alias = "startDate")] @@ -96,7 +95,7 @@ impl Calendar { Some(Ok(EventInstance { calendar_ui: self.config.ui.clone(), dtstart, - location: ev.location.clone(), + location: Some(ev.location.clone()), recurrence_id: None, summary: Some(ev.event_name.clone()), uid: Some(ev.id.clone()), @@ -112,10 +111,9 @@ impl Calendar { } pub(crate) fn read_from_config(config: Config) -> Result { - let path = config.dl.file_path.clone(); - let s = - std::fs::read_to_string(&path).with_context(|| format!("Couldn't read {path:?}"))?; - Self::read_from_str(config, &s).with_context(|| format!("Couldn't parse {path:?}")) + let path = &config.dl.file_path; + let s = std::fs::read_to_string(path).with_context(|| format!("Couldn't read {path:?}"))?; + Self::read_from_str(config, &s) } } diff --git a/src/wac_common_ninja.rs b/src/wac_common_ninja.rs index 4647023..6a1d085 100644 --- a/src/wac_common_ninja.rs +++ b/src/wac_common_ninja.rs @@ -95,10 +95,9 @@ impl Calendar { } pub(crate) fn read_from_config(config: Config) -> Result { - let path = config.dl.file_path.clone(); - let s = - std::fs::read_to_string(&path).with_context(|| format!("Couldn't read {path:?}"))?; - Self::read_from_str(config, &s).with_context(|| format!("Couldn't parse {path:?}")) + let path = &config.dl.file_path; + let s = std::fs::read_to_string(path).with_context(|| format!("Couldn't read {path:?}"))?; + Self::read_from_str(config, &s) } } diff --git a/src/wac_ical.rs b/src/wac_ical.rs index dae03ef..9bebdc2 100644 --- a/src/wac_ical.rs +++ b/src/wac_ical.rs @@ -267,9 +267,8 @@ impl Calendar { } pub(crate) fn read_from_config(config: Config) -> Result { - let path = config.dl.file_path.clone(); - let s = - std::fs::read_to_string(&path).with_context(|| format!("Couldn't read {path:?}"))?; - Self::read_from_str(config, &s).with_context(|| format!("Couldn't parse {path:?}")) + let path = &config.dl.file_path; + let s = std::fs::read_to_string(path).with_context(|| format!("Couldn't read {path:?}"))?; + Self::read_from_str(config, &s) } }