So here this shouldn't be doen like this because you are mixing meanings.  The way it is written it looks like you can just put an arbitrary set of messages in whatever order you want.  However, below in trigger streams you use the enum value itself to then index into the rates array.  That means if you reordered this array it would break.  So not a bug right now, but easily becomes one and this can easily be avoided.

So you can choose - do you want the rates to be associated with a message slot (index into MAVstreams) or with the actual message.  For the former the code I wrote above would work just fine since you would index into the mavrates with the message array index. If the later you can still do this:

    static const unit16_t MAVrates[MAXSTREAMS] = {
        [MY_MAV_DATA_STREAM_EXTENDED_STATUS] = 2,
        [MY_MAV_DATA_STREAM_RC_CHANNELS] = 5

or if you do as I suggest above and use the real message IDs then it would be

    static const unit16_t MAVrates[NUMBER_OF_MAVLINK_MESSAGES] = {
        [MAVLINK_MSG_ID_ATTITUDE] = 2,

and it will make the others default to 0.  It will waste a bit of flash but makes things clear.