Skip to content

Commit 3be7fa1

Browse files
committed
minor simplify
1 parent c01c599 commit 3be7fa1

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/rule.ml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,11 @@ module Project_owners = struct
135135
| _ :: _ ->
136136
let pr_labels_set = List.map ~f:(fun (l : Github_t.label) -> l.name) pr_labels |> SS.of_list in
137137
let do_match { label; labels; owners } =
138-
let labels =
139-
match labels with
140-
| [] -> Option.value_map label ~f:(fun l -> [ l ]) ~default:[]
141-
| labels -> labels
142-
in
143138
match owners with
144139
| [] -> false
145140
| _ :: _ ->
146-
match labels with
141+
match Option.to_list label @ labels with
147142
| [] -> false
148-
| [ label ] -> SS.mem label pr_labels_set
149143
| labels -> SS.subset (SS.of_list labels) pr_labels_set
150144
in
151145
List.find ~f:do_match rules |> Option.value_map ~default:[] ~f:(fun l -> l.owners)

0 commit comments

Comments
 (0)