needless pass by value

This commit is contained in:
Mylloon 2024-11-28 19:58:45 +01:00
parent 48a1518d7f
commit 1ddeefa727
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 6 additions and 6 deletions

View file

@ -92,15 +92,15 @@ fn build_page(config: Config) -> String {
MType::Generic, MType::Generic,
); );
let mut socials = read(FilePath { let mut socials = read(&FilePath {
base: contacts_dir.clone(), base: contacts_dir.clone(),
path: format!("socials/*{ext}"), path: format!("socials/*{ext}"),
}); });
let mut forges = read(FilePath { let mut forges = read(&FilePath {
base: contacts_dir.clone(), base: contacts_dir.clone(),
path: format!("forges/*{ext}"), path: format!("forges/*{ext}"),
}); });
let mut others = read(FilePath { let mut others = read(&FilePath {
base: contacts_dir, base: contacts_dir,
path: format!("others/*{ext}"), path: format!("others/*{ext}"),
}); });

View file

@ -159,7 +159,7 @@ fn custom_img_size(html: &str) -> String {
/// Fix local images to base64 and integration of markdown files /// Fix local images to base64 and integration of markdown files
fn fix_images_and_integration( fn fix_images_and_integration(
path: FilePath, path: &FilePath,
html: &str, html: &str,
metadata_type: MType, metadata_type: MType,
recursive: bool, recursive: bool,
@ -258,7 +258,7 @@ pub fn read_md(
let children_metadata; let children_metadata;
let mail_obfsucated; let mail_obfsucated;
(html_content, children_metadata) = (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 = custom_img_size(&html_content);
(html_content, mail_obfsucated) = mail_obfuscation(&html_content); (html_content, mail_obfsucated) = mail_obfuscation(&html_content);

View file

@ -54,7 +54,7 @@ pub fn remove_paragraphs(list: &mut [File]) {
.for_each(|file| file.content = file.content.replace("<p>", "").replace("</p>", "")); .for_each(|file| file.content = file.content.replace("<p>", "").replace("</p>", ""));
} }
pub fn read(path: FilePath) -> Vec<File> { pub fn read(path: &FilePath) -> Vec<File> {
glob(&path.to_string()) glob(&path.to_string())
.unwrap() .unwrap()
.map(|e| read_file(path.from(&e.unwrap().to_string_lossy()), MType::Contact).unwrap()) .map(|e| read_file(path.from(&e.unwrap().to_string_lossy()), MType::Contact).unwrap())