remove duplicate code in validation - #2701
Conversation
Dry-run check results |
| errors.push(e.to_string()); | ||
| } | ||
|
|
||
| let alumni = team |
There was a problem hiding this comment.
Cloning iterators is a bit icky, I usually create a closure instead (let alumni = || ...) and then call it repeatedly.
|
Alternatively, to reduce some of the duplication already, the |
|
Also actually, with the |
|
so you just need 2 checks total; one on |
|
Yeah, but this situation is so rare that I didn't want to bother with it. And if we only check members + alumni together, then the error message will be misleading (it would have to be generalized to something like "there is duplication either amongst members or members + alumni"). |
|
This is what I thought it can look like: #2702 |
f55d02d to
23c40d2
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Thanks both! |
I extracted a variable.
AI disclosure
I used GPT5.6-Sol with the codex harness to generate this change. I reviewed its output and changed it where necessary.