Skip to content

Commit

Permalink
Neat: fix code fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerchai committed Aug 25, 2020
1 parent 14c33c8 commit 292a8ce
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/casbin_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,30 @@ impl<T: IEnforcer + 'static> Handler<CasbinCmd> for CasbinActor<T> {
.add_policies(policy)
.await
.map(CasbinResult::AddPolicies),
CasbinCmd::AddNamedPolicy(ptype, policy) => lock.add_named_policy(&ptype,policy).await.map(CasbinResult::AddNamedPolicy),
CasbinCmd::AddNamedPolicies(ptype, policy) => lock.add_named_policies(&ptype,policy).await.map(CasbinResult::AddNamedPolicies),
CasbinCmd::AddGroupingPolicy(policy) => lock.add_grouping_policy(policy).await.map(CasbinResult::AddGroupingPolicy),
CasbinCmd::AddGroupingPolicies(policy) => lock.add_grouping_policies(policy).await.map(CasbinResult::AddGroupingPolicies),
CasbinCmd::AddNamedGroupingPolicy(ptype, policy) => lock.add_named_grouping_policy(&ptype, policy).await.map(CasbinResult::AddNamedGroupingPolicy),
CasbinCmd::AddNamedGroupingPolicies(ptype, policy) => lock.add_named_grouping_policies(&ptype, policy).await.map(CasbinResult::AddNamedGroupingPolicies),
CasbinCmd::AddNamedPolicy(ptype, policy) => lock
.add_named_policy(&ptype, policy)
.await
.map(CasbinResult::AddNamedPolicy),
CasbinCmd::AddNamedPolicies(ptype, policy) => lock
.add_named_policies(&ptype, policy)
.await
.map(CasbinResult::AddNamedPolicies),
CasbinCmd::AddGroupingPolicy(policy) => lock
.add_grouping_policy(policy)
.await
.map(CasbinResult::AddGroupingPolicy),
CasbinCmd::AddGroupingPolicies(policy) => lock
.add_grouping_policies(policy)
.await
.map(CasbinResult::AddGroupingPolicies),
CasbinCmd::AddNamedGroupingPolicy(ptype, policy) => lock
.add_named_grouping_policy(&ptype, policy)
.await
.map(CasbinResult::AddNamedGroupingPolicy),
CasbinCmd::AddNamedGroupingPolicies(ptype, policy) => lock
.add_named_grouping_policies(&ptype, policy)
.await
.map(CasbinResult::AddNamedGroupingPolicies),
CasbinCmd::RemovePolicy(policy) => lock
.remove_policy(policy)
.await
Expand Down

0 comments on commit 292a8ce

Please sign in to comment.