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()), - }]) - } -}