From 1a3f048b43da4a9019d540f0101cae0b45c1d783 Mon Sep 17 00:00:00 2001 From: PramUkesh Date: Thu, 25 Jan 2024 14:27:42 +0530 Subject: [PATCH] core::io::ContentMod > change fn load_content_from_path signature --- src/core/io.rs | 2 +- src/io/content.rs | 2 +- src/io/site.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/io.rs b/src/core/io.rs index 4512a94..ef207ac 100644 --- a/src/core/io.rs +++ b/src/core/io.rs @@ -23,7 +23,7 @@ pub trait UserIO { #[async_trait::async_trait] pub trait ContentMod { type ContentType; - async fn load_content_from_path(&self, inner_path: String) -> Result; + async fn load_content_from_path(&self, inner_path: &str) -> Result; async fn add_file_to_content(&mut self, path: PathBuf) -> Result<(), Error>; async fn sign_content( &mut self, diff --git a/src/io/content.rs b/src/io/content.rs index aaa3484..a2aceaf 100644 --- a/src/io/content.rs +++ b/src/io/content.rs @@ -18,7 +18,7 @@ use super::utils::current_unix_epoch; #[async_trait::async_trait] impl ContentMod for Site { type ContentType = Content; - async fn load_content_from_path(&self, inner_path: String) -> Result { + async fn load_content_from_path(&self, inner_path: &str) -> Result { let path = &self.site_path().join(&inner_path); if path.is_file() { let mut file = File::open(path).await?; diff --git a/src/io/site.rs b/src/io/site.rs index 721bec5..7bb9358 100644 --- a/src/io/site.rs +++ b/src/io/site.rs @@ -236,7 +236,7 @@ impl Site { let user_data = user_data_files .iter() - .map(|path| self.load_content_from_path(path.clone())) + .map(|path| self.load_content_from_path(path)) .collect::>(); let mut content_res = join_all(user_data).await; let errs = content_res