I think the trade off is branch prediction vs cache utilization.
it seems the threshold is 2 by experiments with simple examples. when the match has only 2 arms (plus the wildcard), it generates cascaded conditional branches; as long I add the third match arm, it turns into a table lookup.
PS:
I like use byte string literal patterns, both generate the same code nevertheless, just personal preference.
PPS:
for some reason if I use string literal patterns (instead of byte string literals), it generate different code (supprising to me) using conditional branches.
You should almost certainly just use a match, but you can tune the types a bit if you want.
If you return Option<u8> instead, for example, it no longer needs to generate the external table and just uses a bt: https://rust.godbolt.org/z/G8EnvoYEY