@@ -167,7 +167,7 @@ impl Team {
167
167
& self ,
168
168
gh_client : & dyn GitHubClient ,
169
169
user : & User ,
170
- ) -> AppResult < bool > {
170
+ ) -> Result < bool , GitHubError > {
171
171
match self . org_id {
172
172
Some ( org_id) => {
173
173
team_with_gh_id_contains_user ( gh_client, org_id, self . github_id , user) . await
@@ -200,7 +200,7 @@ async fn can_add_team(
200
200
org_id : i32 ,
201
201
team_id : i32 ,
202
202
user : & User ,
203
- ) -> AppResult < bool > {
203
+ ) -> Result < bool , GitHubError > {
204
204
Ok (
205
205
team_with_gh_id_contains_user ( gh_client, org_id, team_id, user) . await ?
206
206
|| is_gh_org_owner ( gh_client, org_id, user) . await ?,
@@ -211,15 +211,15 @@ async fn is_gh_org_owner(
211
211
gh_client : & dyn GitHubClient ,
212
212
org_id : i32 ,
213
213
user : & User ,
214
- ) -> AppResult < bool > {
214
+ ) -> Result < bool , GitHubError > {
215
215
let token = AccessToken :: new ( user. gh_access_token . expose_secret ( ) . to_string ( ) ) ;
216
216
match gh_client
217
217
. org_membership ( org_id, & user. gh_login , & token)
218
218
. await
219
219
{
220
220
Ok ( membership) => Ok ( membership. state == "active" && membership. role == "admin" ) ,
221
221
Err ( GitHubError :: NotFound ( _) ) => Ok ( false ) ,
222
- Err ( e) => Err ( e. into ( ) ) ,
222
+ Err ( e) => Err ( e) ,
223
223
}
224
224
}
225
225
@@ -228,7 +228,7 @@ async fn team_with_gh_id_contains_user(
228
228
github_org_id : i32 ,
229
229
github_team_id : i32 ,
230
230
user : & User ,
231
- ) -> AppResult < bool > {
231
+ ) -> Result < bool , GitHubError > {
232
232
// GET /organizations/:org_id/team/:team_id/memberships/:username
233
233
// check that "state": "active"
234
234
0 commit comments