From 6fff1d768539b33ed87dfb0c2007e2d956344013 Mon Sep 17 00:00:00 2001 From: CodingTil <36734749+CodingTil@users.noreply.github.com> Date: Sat, 24 Feb 2024 15:26:20 +0100 Subject: [PATCH] Removing unneccesary variable declarations --- src/components/content_education.rs | 5 ++--- src/components/content_teaching.rs | 5 ++--- src/components/project.rs | 8 +++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/components/content_education.rs b/src/components/content_education.rs index dbffdc9..8c084a3 100644 --- a/src/components/content_education.rs +++ b/src/components/content_education.rs @@ -27,14 +27,13 @@ pub fn ContentEducation(props: &ContentEducationProps) -> Html { // Get Front Matter let document = YamlFrontMatter::parse::(&md_str).unwrap(); - let front_matter = document.metadata; - let md = document.content; let Metadata { title, education, date_range, location, - } = front_matter; + } = document.metadata; + let md = document.content; html! { Html { // Get Front Matter let document = YamlFrontMatter::parse::(&md_str).unwrap(); - let front_matter = document.metadata; - let md = document.content; let Metadata { title, employer, date_range, location, - } = front_matter; + } = document.metadata; + let md = document.content; html! { Html { // Get Front Matter let document = YamlFrontMatter::parse::(&md_str).unwrap(); - let front_matter = document.metadata; let ProjectMetadata { slug, image, @@ -59,7 +58,7 @@ pub fn ProjectCard(props: &ProjectCardProps) -> Html { filters: _, coauthors: _, report: _, - } = front_matter; + } = document.metadata; let size_css = style!( r#" @@ -137,8 +136,6 @@ pub fn ProjectPost(props: &ProjectCardProps) -> Html { // Get Front Matter let document = YamlFrontMatter::parse::(&md_str).unwrap(); - let front_matter = document.metadata; - let md = document.content; let ProjectMetadata { slug: _, image: _, @@ -151,7 +148,8 @@ pub fn ProjectPost(props: &ProjectCardProps) -> Html { filters: _, coauthors, report, - } = front_matter; + } = document.metadata; + let md = document.content; let arena = Arena::new(); let mut options = ComrakOptions::default();