Hacker News new | ask | show | jobs
by iudqnolq 1876 days ago
I wrote a hacky helper for this sort of thing the other day. It takes a vector of values and a vector of functions. For each value it scans the functions until one returns true, and then pops off that function. If either list isn't empty it prints the unmatched items and panics.