Skip to content

Commit

Permalink
core::io::ContentMod > change fn load_content_from_path signature
Browse files Browse the repository at this point in the history
  • Loading branch information
canewsin committed Jan 25, 2024
1 parent b4b925c commit 1a3f048
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::ContentType, Error>;
async fn load_content_from_path(&self, inner_path: &str) -> Result<Self::ContentType, Error>;
async fn add_file_to_content(&mut self, path: PathBuf) -> Result<(), Error>;
async fn sign_content(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion src/io/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::ContentType, Error> {
async fn load_content_from_path(&self, inner_path: &str) -> Result<Self::ContentType, Error> {
let path = &self.site_path().join(&inner_path);
if path.is_file() {
let mut file = File::open(path).await?;
Expand Down
2 changes: 1 addition & 1 deletion src/io/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
let mut content_res = join_all(user_data).await;
let errs = content_res
Expand Down

0 comments on commit 1a3f048

Please sign in to comment.