Skip to content

Commit

Permalink
Removing unneccesary variable declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingTil committed Feb 24, 2024
1 parent 51a80d4 commit 6fff1d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/components/content_education.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ pub fn ContentEducation(props: &ContentEducationProps) -> Html {

// Get Front Matter
let document = YamlFrontMatter::parse::<Metadata>(&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! {
<ContentItem
Expand Down
5 changes: 2 additions & 3 deletions src/components/content_teaching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ pub fn ContentTeaching(props: &ContentTeachingProps) -> Html {

// Get Front Matter
let document = YamlFrontMatter::parse::<Metadata>(&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! {
<ContentItem
Expand Down
8 changes: 3 additions & 5 deletions src/components/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub fn ProjectCard(props: &ProjectCardProps) -> Html {

// Get Front Matter
let document = YamlFrontMatter::parse::<ProjectMetadata>(&md_str).unwrap();
let front_matter = document.metadata;
let ProjectMetadata {
slug,
image,
Expand All @@ -59,7 +58,7 @@ pub fn ProjectCard(props: &ProjectCardProps) -> Html {
filters: _,
coauthors: _,
report: _,
} = front_matter;
} = document.metadata;

let size_css = style!(
r#"
Expand Down Expand Up @@ -137,8 +136,6 @@ pub fn ProjectPost(props: &ProjectCardProps) -> Html {

// Get Front Matter
let document = YamlFrontMatter::parse::<ProjectMetadata>(&md_str).unwrap();
let front_matter = document.metadata;
let md = document.content;
let ProjectMetadata {
slug: _,
image: _,
Expand All @@ -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();
Expand Down

0 comments on commit 6fff1d7

Please sign in to comment.