Function verdict_set

Source
pub fn verdict_set(theirs: &[String], yours: &[String]) -> Verdict
Expand description

The verdict for a field that holds a set, not a value: genres.

Comparing sets as strings is what produced the first false alarm of this layer: MusicBrainz said pop, dance-pop, electropop, europop, the files said Rock, Pop, and the report called that a disagreement. It is not. The tags say the record is pop and rock; MusicBrainz says pop and three finer words for it. Nobody is contradicting anybody.

So the rule is overlap, not equality. Genres are not exclusive and the two sides are not even trying to answer with the same granularity — one is what a crowd voted, the other is what one person typed. A shared name is agreement; only two sets with nothing at all in common are a difference worth showing.

Splitting is done here rather than by the caller because a genre tag is written in every shape: several tag values, or one value holding Rock, Pop, Rock; Pop or Rock / Pop. All of them mean a list.