needless pass by value

This commit is contained in:
Mylloon 2024-11-28 19:59:24 +01:00
parent 1ddeefa727
commit 04a8eead65
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 4 additions and 4 deletions

View file

@ -192,7 +192,7 @@ fn fix_images_and_integration(
let mut options = get_options(Some(path.clone()), metadata_type); let mut options = get_options(Some(path.clone()), metadata_type);
options.extension.footnotes = false; options.extension.footnotes = false;
let data = read_md( let data = read_md(
path.from(&img_path), &path.from(&img_path),
&file, &file,
metadata_type, metadata_type,
Some(options), Some(options),
@ -226,7 +226,7 @@ fn fix_images_and_integration(
/// Transform markdown string to File structure /// Transform markdown string to File structure
pub fn read_md( pub fn read_md(
path: FilePath, path: &FilePath,
raw_text: &str, raw_text: &str,
metadata_type: MType, metadata_type: MType,
options: Option<Options>, options: Option<Options>,
@ -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

@ -64,7 +64,7 @@ pub fn read_file(filename: FilePath, expected_file: MType) -> Option<File> {
.and_then(|ext| match ext.to_str().unwrap() { .and_then(|ext| match ext.to_str().unwrap() {
"pdf" => fs::read(&as_str).map_or(None, |bytes| Some(read_pdf(bytes))), "pdf" => fs::read(&as_str).map_or(None, |bytes| Some(read_pdf(bytes))),
_ => fs::read_to_string(&as_str).map_or(None, |text| { _ => fs::read_to_string(&as_str).map_or(None, |text| {
Some(read_md(filename, &text, expected_file, None, true)) Some(read_md(&filename, &text, expected_file, None, true))
}), }),
}) })
} }