@@ -282,9 +282,6 @@ async fn determine_assignee(
282
282
let db_client = ctx. db . get ( ) . await ;
283
283
let teams = crate :: team_data:: teams ( & ctx. github ) . await ?;
284
284
if let Some ( name) = find_assign_command ( ctx, event) {
285
- if is_self_assign ( & name, & event. issue . user . login ) {
286
- return Ok ( ( Some ( name. to_string ( ) ) , true ) ) ;
287
- }
288
285
// User included `r?` in the opening PR body.
289
286
match find_reviewer_from_names ( & db_client, & teams, config, & event. issue , & [ name] ) . await {
290
287
Ok ( assignee) => return Ok ( ( Some ( assignee) , true ) ) ,
@@ -739,6 +736,13 @@ async fn find_reviewer_from_names(
739
736
issue : & Issue ,
740
737
names : & [ String ] ,
741
738
) -> Result < String , FindReviewerError > {
739
+ // Fast path for self-assign, which is always allowed.
740
+ if let [ name] = names {
741
+ if is_self_assign ( & name, & issue. user . login ) {
742
+ return Ok ( name. clone ( ) ) ;
743
+ }
744
+ }
745
+
742
746
let candidates = candidate_reviewers_from_names ( teams, config, issue, names) ?;
743
747
// This uses a relatively primitive random choice algorithm.
744
748
// GitHub's CODEOWNERS supports much more sophisticated options, such as:
0 commit comments