@@ -167,7 +167,7 @@ impl Team {
167167 & self ,
168168 gh_client : & dyn GitHubClient ,
169169 user : & User ,
170- ) -> AppResult < bool > {
170+ ) -> Result < bool , GitHubError > {
171171 match self . org_id {
172172 Some ( org_id) => {
173173 team_with_gh_id_contains_user ( gh_client, org_id, self . github_id , user) . await
@@ -200,7 +200,7 @@ async fn can_add_team(
200200 org_id : i32 ,
201201 team_id : i32 ,
202202 user : & User ,
203- ) -> AppResult < bool > {
203+ ) -> Result < bool , GitHubError > {
204204 Ok (
205205 team_with_gh_id_contains_user ( gh_client, org_id, team_id, user) . await ?
206206 || is_gh_org_owner ( gh_client, org_id, user) . await ?,
@@ -211,15 +211,15 @@ async fn is_gh_org_owner(
211211 gh_client : & dyn GitHubClient ,
212212 org_id : i32 ,
213213 user : & User ,
214- ) -> AppResult < bool > {
214+ ) -> Result < bool , GitHubError > {
215215 let token = AccessToken :: new ( user. gh_access_token . expose_secret ( ) . to_string ( ) ) ;
216216 match gh_client
217217 . org_membership ( org_id, & user. gh_login , & token)
218218 . await
219219 {
220220 Ok ( membership) => Ok ( membership. state == "active" && membership. role == "admin" ) ,
221221 Err ( GitHubError :: NotFound ( _) ) => Ok ( false ) ,
222- Err ( e) => Err ( e. into ( ) ) ,
222+ Err ( e) => Err ( e) ,
223223 }
224224}
225225
@@ -228,7 +228,7 @@ async fn team_with_gh_id_contains_user(
228228 github_org_id : i32 ,
229229 github_team_id : i32 ,
230230 user : & User ,
231- ) -> AppResult < bool > {
231+ ) -> Result < bool , GitHubError > {
232232 // GET /organizations/:org_id/team/:team_id/memberships/:username
233233 // check that "state": "active"
234234
0 commit comments