I've got a slice of bytes and I want to be able to do different things depending on the bytes at the start of the slice. The obvious way to do this would be a match statement with subslice pattern matching. I've gotten that to work by manually creating the byte array, but that's very verbose and tedious to do. I've tried making it work with byte string literals, but haven't found a way to make that work with subslices.
let slice: &[u8] = b"FooBar";
match slice
{
[b'F', b'o', b'o', ..] => , //Works, but is terrible
b"Foo" => //Doesn't work
// b"Foo".. => // Would like something like this to work
}