From 1ddeefa72703de0d05853634819eecdb4b1de91f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Nov 2024 19:58:45 +0100 Subject: [PATCH] needless pass by value --- src/routes/contact.rs | 6 +++--- src/utils/markdown.rs | 4 ++-- src/utils/routes/contact.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/contact.rs b/src/routes/contact.rs index 56a8396..56c6dcb 100644 --- a/src/routes/contact.rs +++ b/src/routes/contact.rs @@ -92,15 +92,15 @@ fn build_page(config: Config) -> String { MType::Generic, ); - let mut socials = read(FilePath { + let mut socials = read(&FilePath { base: contacts_dir.clone(), path: format!("socials/*{ext}"), }); - let mut forges = read(FilePath { + let mut forges = read(&FilePath { base: contacts_dir.clone(), path: format!("forges/*{ext}"), }); - let mut others = read(FilePath { + let mut others = read(&FilePath { base: contacts_dir, path: format!("others/*{ext}"), }); diff --git a/src/utils/markdown.rs b/src/utils/markdown.rs index 83a6492..c193b67 100644 --- a/src/utils/markdown.rs +++ b/src/utils/markdown.rs @@ -159,7 +159,7 @@ fn custom_img_size(html: &str) -> String { /// Fix local images to base64 and integration of markdown files fn fix_images_and_integration( - path: FilePath, + path: &FilePath, html: &str, metadata_type: MType, recursive: bool, @@ -258,7 +258,7 @@ pub fn read_md( let children_metadata; let mail_obfsucated; (html_content, children_metadata) = - fix_images_and_integration(path, &html_content, metadata_type, recursive); + fix_images_and_integration(&path, &html_content, metadata_type, recursive); html_content = custom_img_size(&html_content); (html_content, mail_obfsucated) = mail_obfuscation(&html_content); diff --git a/src/utils/routes/contact.rs b/src/utils/routes/contact.rs index d4128fd..f8c58bf 100644 --- a/src/utils/routes/contact.rs +++ b/src/utils/routes/contact.rs @@ -54,7 +54,7 @@ pub fn remove_paragraphs(list: &mut [File]) { .for_each(|file| file.content = file.content.replace("

", "").replace("

", "")); } -pub fn read(path: FilePath) -> Vec { +pub fn read(path: &FilePath) -> Vec { glob(&path.to_string()) .unwrap() .map(|e| read_file(path.from(&e.unwrap().to_string_lossy()), MType::Contact).unwrap())