From a56b12621d9f8c34017995a518e61ef7ee2b0f64 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Sat, 12 Jul 2025 16:46:32 +0200 Subject: feat: get user --- src/state.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/state.rs') 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); +pub struct AppHandle(Arc); impl Deref for AppHandle { type Target = Arc; @@ -19,12 +17,12 @@ impl Deref for AppHandle { } pub struct AppState { - users: RwLock>, + pub users: RwLock>, } impl AppState { pub async fn new() -> Result, AppError> { - let user = LocalUser::new("sellershut")?; + let user = User::new("sellershut")?; let domain = "localhost"; let config = FederationConfig::builder() -- cgit v1.2.3