technocreatives / dbc-codegen

Generate Rust structs for messages from a dbc (CAN bus definition) file.
Apache License 2.0
48 stars 27 forks source link

Manually implement debug to support `:#?` #29

Closed killercup closed 3 years ago

killercup commented 3 years ago

The usual debug now print like a tuple, while the alternative form prints the decoded fields.

Along the way, I also enabled range checks in tests and fixed the fallout from that.

This also adds a couple lint settings, that happen to fix #28.

killercup commented 3 years ago

@marcelbuesing what do you think? I've wanted to do this for a while, and it's also to help debug #27 :)

marcelbuesing commented 3 years ago

I think this is a really good idea, especially the alternate implementation that way it's easily possible to easily look at both the raw data as well as the fields. Looks good to me.