]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/generate.rs
Deal with all lints
[rbdr/blog] / src / command / generate.rs
index a79058de636fb4a78401534c9ca4b53034d3eb6b..b74b33b3dbb31abf80c7481e8fcf0443f7129819 100644 (file)
@@ -16,12 +16,12 @@ impl Generate {
         Generate
     }
 
-    fn read_posts(&self, posts_directory: &Path, max_posts: u8) -> Vec<Post> {
+    fn read_posts(posts_directory: &Path, max_posts: u8) -> Vec<Post> {
         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<Post> {
+    fn read_post(post_directory: &Path, index: u8) -> Option<Post> {
         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,