From 82f15733fa3fada4ac5b1545006f2ddf7be1805d Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:43:41 +0200 Subject: [PATCH] Remove users store prototype --- crates/store/src/lib.rs | 2 +- crates/store/src/users.rs | 39 --------------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 crates/store/src/users.rs diff --git a/crates/store/src/lib.rs b/crates/store/src/lib.rs index 18b38bc..7c035ea 100644 --- a/crates/store/src/lib.rs +++ b/crates/store/src/lib.rs @@ -1,2 +1,2 @@ pub mod calendar; -pub mod users; +pub mod models; diff --git a/crates/store/src/users.rs b/crates/store/src/users.rs deleted file mode 100644 index 8735815..0000000 --- a/crates/store/src/users.rs +++ /dev/null @@ -1,39 +0,0 @@ -use anyhow::{anyhow, Result}; -use async_trait::async_trait; -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct User { - pub id: String, - pub name: Option, -} - -impl User {} - -#[async_trait] -pub trait UserStore: Send + Sync + 'static { - async fn get_user(&self, id: &str) -> Result; - async fn get_users(&self) -> Result>; -} - -pub struct TestUserStore {} - -#[async_trait] -impl UserStore for TestUserStore { - async fn get_user(&self, id: &str) -> Result { - if id != "test" { - return Err(anyhow!("asd")); - } - Ok(User { - id: "test".to_string(), - name: Some("test".to_string()), - }) - } - - async fn get_users(&self) -> Result> { - Ok(vec![User { - id: "test".to_string(), - name: Some("test".to_string()), - }]) - } -}