diff options
Diffstat (limited to 'src/state.rs')
-rw-r--r-- | src/state.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/state.rs b/src/state.rs index 64c2e7c..d7c9136 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,14 +1,12 @@ -use std::{ - ops::Deref, - sync::{Arc, RwLock}, -}; +use std::{ops::Deref, sync::Arc}; use activitypub_federation::config::FederationConfig; +use tokio::sync::RwLock; -use crate::{entity::user::LocalUser, error::AppError}; +use crate::{entity::user::User, error::AppError}; #[derive(Clone)] -pub struct AppHandle(pub Arc<AppState>); +pub struct AppHandle(Arc<AppState>); impl Deref for AppHandle { type Target = Arc<AppState>; @@ -19,12 +17,12 @@ impl Deref for AppHandle { } pub struct AppState { - users: RwLock<Vec<LocalUser>>, + pub users: RwLock<Vec<User>>, } impl AppState { pub async fn new() -> Result<FederationConfig<AppHandle>, AppError> { - let user = LocalUser::new("sellershut")?; + let user = User::new("sellershut")?; let domain = "localhost"; let config = FederationConfig::builder() |