summary refs log tree commit diff stats
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/db.rs b/src/db.rs
index 02cd776..20ad5a1 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -22,7 +22,7 @@ pub struct Post {
 
 #[derive(Debug, Deserialize, Serialize)]
 pub struct Posts {
-    pub posts: Vec<Post>,
+    posts: Vec<Post>,
 }
 
 #[derive(Debug)]
@@ -90,6 +90,10 @@ impl Posts {
             "Couldn't write data to clinte.json",
         );
     }
+
+    pub fn posts(&self) -> Vec<Post> {
+        self.posts.clone()
+    }
 }
 
 #[cfg(test)]