summary refs log tree commit diff stats
path: root/src/db.rs
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-08-28 00:01:42 -0400
committerBen Morrison <ben@gbmor.dev>2019-08-28 00:01:42 -0400
commit7e4251d8aad41852e18ce9449c3e818cbca44fe0 (patch)
tree7e5da25ad1fc39a6c88110b4a6854002cc596aa8 /src/db.rs
parentc664e872aaa0f99a96c191ffbbf06e85851df726 (diff)
downloadclinte-7e4251d8aad41852e18ce9449c3e818cbca44fe0.tar.gz
cleanup
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/db.rs b/src/db.rs
index a0cc2cf..fe10325 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -17,14 +17,6 @@ pub struct Conn {
     pub conn: rusqlite::Connection,
 }
 
-#[derive(Debug)]
-pub enum Cmd {
-    Create(Post),
-    Update(Post),
-    Disconnect,
-    NOOP,
-}
-
 impl Conn {
     fn init() -> rusqlite::Connection {
         let start = time::Instant::now();
@@ -60,29 +52,3 @@ impl Conn {
         Conn { conn: Conn::init() }
     }
 }
-
-impl Cmd {
-    pub fn new(txt: &str, post: Post) -> Self {
-        match txt {
-            "create" => Cmd::Create(post),
-            "update" => Cmd::Update(post),
-            "disconnect" => Cmd::Disconnect,
-            _ => Cmd::NOOP,
-        }
-    }
-}
-
-impl Post {
-    pub fn new(title: &str, author: &str, body: &str) -> Self {
-        let id = 0;
-        let title = title.to_string();
-        let author = author.to_string();
-        let body = body.to_string();
-        Post {
-            id,
-            title,
-            author,
-            body,
-        }
-    }
-}