diff --git a/crates/adapters/activitypub/src/social_adapter.rs b/crates/adapters/activitypub/src/social_adapter.rs index 856806a..e316965 100644 --- a/crates/adapters/activitypub/src/social_adapter.rs +++ b/crates/adapters/activitypub/src/social_adapter.rs @@ -242,5 +242,4 @@ impl SocialQuery for CompositeSocialAdapter { let following = self.get_following(follower).await?; Ok(following.iter().any(|a| a.identity == *target)) } - } diff --git a/crates/application/src/diary/tests/get_activity_feed.rs b/crates/application/src/diary/tests/get_activity_feed.rs index 512425d..2745360 100644 --- a/crates/application/src/diary/tests/get_activity_feed.rs +++ b/crates/application/src/diary/tests/get_activity_feed.rs @@ -67,10 +67,7 @@ struct FakeSocialWithFollowing(Vec); #[async_trait] impl domain::ports::SocialQuery for FakeSocialWithFollowing { - async fn get_following( - &self, - _: &UserId, - ) -> Result, DomainError> { + async fn get_following(&self, _: &UserId) -> Result, DomainError> { Ok(self.0.clone()) } async fn get_followers(&self, _: &UserId) -> Result, DomainError> { diff --git a/crates/application/src/social/execute.rs b/crates/application/src/social/execute.rs index 4ca8fff..d57005a 100644 --- a/crates/application/src/social/execute.rs +++ b/crates/application/src/social/execute.rs @@ -10,10 +10,7 @@ use super::{ queries::SocialQry, }; -pub async fn execute_command( - deps: &SocialCommandDeps, - cmd: SocialCmd, -) -> Result<(), DomainError> { +pub async fn execute_command(deps: &SocialCommandDeps, cmd: SocialCmd) -> Result<(), DomainError> { let event = match cmd { SocialCmd::Follow { follower_id, @@ -58,18 +55,12 @@ pub async fn execute_command( .await?; DomainEvent::FollowerRemoved { owner, follower } } - SocialCmd::Block { - blocker_id, - target, - } => { + SocialCmd::Block { blocker_id, target } => { let blocker = UserId::from_uuid(blocker_id); deps.social_command.block(&blocker, &target).await?; DomainEvent::ActorBlocked { blocker, target } } - SocialCmd::Unblock { - blocker_id, - target, - } => { + SocialCmd::Unblock { blocker_id, target } => { let blocker = UserId::from_uuid(blocker_id); deps.social_command.unblock(&blocker, &target).await?; DomainEvent::ActorUnblocked { blocker, target } diff --git a/crates/application/src/social/tests/execute.rs b/crates/application/src/social/tests/execute.rs index c0abd8e..e8862c8 100644 --- a/crates/application/src/social/tests/execute.rs +++ b/crates/application/src/social/tests/execute.rs @@ -39,9 +39,9 @@ async fn follow_emits_follow_requested_event() { &deps, SocialCmd::Follow { follower_id: Uuid::new_v4(), - target: FollowTarget::Identity(SocialIdentity::Local(UserId::from_uuid( - Uuid::new_v4(), - ))), + target: FollowTarget::Identity(SocialIdentity::Local( + UserId::from_uuid(Uuid::new_v4()), + )), }, ) .await diff --git a/crates/domain/src/ports/noop.rs b/crates/domain/src/ports/noop.rs index 670a0af..592bb17 100644 --- a/crates/domain/src/ports/noop.rs +++ b/crates/domain/src/ports/noop.rs @@ -41,7 +41,11 @@ pub struct NoopSocialCommand; #[async_trait] impl super::SocialCommand for NoopSocialCommand { - async fn follow(&self, _: &UserId, _: &crate::value_objects::FollowTarget) -> Result<(), DomainError> { + async fn follow( + &self, + _: &UserId, + _: &crate::value_objects::FollowTarget, + ) -> Result<(), DomainError> { Ok(()) } async fn unfollow(&self, _: &UserId, _: &SocialIdentity) -> Result<(), DomainError> { diff --git a/crates/domain/src/ports/social.rs b/crates/domain/src/ports/social.rs index dd6b196..2530083 100644 --- a/crates/domain/src/ports/social.rs +++ b/crates/domain/src/ports/social.rs @@ -61,7 +61,6 @@ pub trait SocialQuery: Send + Sync { follower: &UserId, target: &SocialIdentity, ) -> Result; - } #[async_trait] diff --git a/crates/domain/src/testing/in_memory.rs b/crates/domain/src/testing/in_memory.rs index 2568868..91dc819 100644 --- a/crates/domain/src/testing/in_memory.rs +++ b/crates/domain/src/testing/in_memory.rs @@ -1105,5 +1105,4 @@ impl SocialQuery for InMemorySocialRepository { *f == follower.value() && t == target && *state == FollowState::Accepted })) } - }