Skip to content

SetExtendedColorZones colors definition #15

Description

@brianmay

I am somewhat uncomfortable with this definition:

colors: Box<[HSBK; 82]>,

It has the following problems:

  • The 82 value is hard-coded, perhaps at bare minimum should be a constant.
  • Creating a Box<[_; 82]> type is non-trivial.
  • Contrary to what the docs say, I don't believe this needs to be exactly 82 entries long in outgoing packets. Sending a packet with less then 82 entries and the correct count in colors_count is OK also. This results in a outgoing packet that is considerably larger then required.

My feeling is this could be replaced with a Vec<HSBK> type.

This in turn could make the colors_count redundant. As the Vec type has its own length. Unless you really do want to ability to parse all 82 colours on incoming packets where colors_count is less then 82.

I could work on a pull request if you want, but thought I should perhaps discuss the issue first :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions