From eb0237792cf5137399a317d5eb6cb46f88327cb8 Mon Sep 17 00:00:00 2001 From: Olivia Brooks <109807080+Cutieguwu@users.noreply.github.com> Date: Wed, 15 Oct 2025 12:41:44 -0400 Subject: [PATCH] Clean up. --- src/convert.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/convert.rs b/src/convert.rs index 93019b1..1000370 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -4,7 +4,12 @@ use std::path::Path; use image::ImageReader; use markdown; -pub fn to_webp(path: &Path) -> Result<(), Box> { +pub fn to_webp

(path: P) -> Result<(), Box> +where + P: AsRef, +{ + let path = path.as_ref(); + ImageReader::open(path)?.decode()?.save(format!( "{}.webp", path.file_stem().unwrap().to_str().unwrap() @@ -13,7 +18,10 @@ pub fn to_webp(path: &Path) -> Result<(), Box> { Ok(()) } -pub fn md_to_html(path: &Path) -> Result { +pub fn md_to_html

(path: P) -> Result +where + P: AsRef, +{ let mut buf = String::new(); // Loading and Converting post.md to html