X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/d7fef30ac3f539975ef9edbba8e0af4a4e9ff3de..b17907faf8d9693cef94a6048d802bd4ced9102f:/src/command/generate.rs?ds=sidebyside diff --git a/src/command/generate.rs b/src/command/generate.rs index a79058d..b74b33b 100644 --- a/src/command/generate.rs +++ b/src/command/generate.rs @@ -16,12 +16,12 @@ impl Generate { Generate } - fn read_posts(&self, posts_directory: &Path, max_posts: u8) -> Vec { + fn read_posts(posts_directory: &Path, max_posts: u8) -> Vec { let mut posts = Vec::new(); for i in 0..max_posts { let post_path = posts_directory.join(i.to_string()); - match self.read_post(&post_path, i) { + match Generate::read_post(&post_path, i) { Some(post) => posts.push(post), None => continue, } @@ -49,7 +49,7 @@ impl Generate { None } - fn read_post(&self, post_directory: &Path, index: u8) -> Option { + fn read_post(post_directory: &Path, index: u8) -> Option { let metadata_path = post_directory.join(METADATA_FILENAME); let metadata = Metadata::read_or_create(&metadata_path); let raw = Generate::find_blog_content(post_directory)?; @@ -73,7 +73,7 @@ impl super::Command for Generate { let _ = remove_dir_all(&configuration.blog_output_directory); create_dir_all(&configuration.blog_output_directory)?; - let posts = self.read_posts(&configuration.posts_directory, configuration.max_posts); + let posts = Generate::read_posts(&configuration.posts_directory, configuration.max_posts); generate( &configuration.static_directory, &configuration.templates_directory,