This kind of code (protocol unpacking) is a proper mare to write cleanly in C. I love how Rust makes it not just easy, but readable too.
@philpem Yeh, 'match' is great; even if you forget all the safety stuff.
@philpem Like this you mean (from me recent adventures with midi - got 3 levels of nested switches in there)