technocreatives / dbc-codegen

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

Fix range check on bool #6

Closed marcelbuesing closed 3 years ago

marcelbuesing commented 3 years ago

Avoid range checks on bool they lead to the following error. Does not really make sense to do to a range check on boolean values anyway.

error: invalid suffix `bool` for number literal
   --> testing/can-messages/src/messages.rs:390:30
    |
390 |         if value < 0_bool || 1_bool < value { return Err(CanError::ParameterOutOfRange{ message_id: 512 }); }
    |                              ^^^^^^ invalid suffix `bool`
    |