diff options
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 6 |
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)] |